You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2025/10/28 20:36:56 UTC
(superset) branch master updated: fix(echarts): fix time shift color matching functionality (#35826)
This is an automated email from the ASF dual-hosted git repository.
msyavuz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 5218b4eea2 fix(echarts): fix time shift color matching functionality (#35826)
5218b4eea2 is described below
commit 5218b4eea29b32cc983138b4ee33941ab65f67f4
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Tue Oct 28 23:36:50 2025 +0300
fix(echarts): fix time shift color matching functionality (#35826)
Co-authored-by: Claude <no...@anthropic.com>
---
.../src/Timeseries/transformProps.ts | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
index dac90937e3..9e897e2952 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
@@ -200,6 +200,7 @@ export default function transformProps(
zoomable,
stackDimension,
}: EchartsTimeseriesFormData = { ...DEFAULT_FORM_DATA, ...formData };
+
const refs: Refs = {};
const groupBy = ensureIsArray(groupby);
const labelMap: { [key: string]: string[] } = Object.entries(
@@ -301,7 +302,24 @@ export default function transformProps(
const entryName = String(entry.name || '');
const seriesName = inverted[entryName] || entryName;
- const colorScaleKey = getOriginalSeries(seriesName, array);
+
+ let colorScaleKey = getOriginalSeries(seriesName, array);
+
+ // If this series name exactly matches a time compare value, it's a time-shifted series
+ // and we need to find the corresponding original series for color matching
+ if (array && array.includes(seriesName)) {
+ // Find the original series (first non-time-compare series)
+ const originalSeries = rawSeries.find(s => {
+ const sName = inverted[String(s.name || '')] || String(s.name || '');
+ return !array.includes(sName);
+ });
+ if (originalSeries) {
+ const originalSeriesName =
+ inverted[String(originalSeries.name || '')] ||
+ String(originalSeries.name || '');
+ colorScaleKey = getOriginalSeries(originalSeriesName, array);
+ }
+ }
const transformedSeries = transformSeries(
entry,