madhushreeag commented on code in PR #37531:
URL: https://github.com/apache/superset/pull/37531#discussion_r2848851257
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts:
##########
@@ -164,6 +164,27 @@ export function transformNegativeLabelsPosition(
return (series.data as TimeseriesDataRecord[]).map(transformValue);
}
+export function applyColorByXAxis(
+ series: SeriesOption,
+ colorScale: CategoricalColorScale,
+ sliceId: number | undefined,
+ opacity: number,
+): TimeseriesDataRecord[] {
+ return (series.data as [string | number, number][]).map(value => {
+ // Use x-axis value as color key so same values get same colors across
charts
+ const colorKey = String(value[0]);
+
+ return {
+ value,
+ itemStyle: {
+ color: colorScale(colorKey, sliceId),
+ opacity,
+ borderWidth: 0,
+ },
+ };
+ });
+}
Review Comment:
fixed - return type explicitly annotated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]