feat: Make time shifted series colors match the original series (#24048)

This commit is contained in:
Michael S. Molina
2023-05-18 08:40:50 -03:00
committed by GitHub
parent ea5d0cc74e
commit df4d16a7ee
7 changed files with 188 additions and 72 deletions

View File

@@ -51,7 +51,6 @@ import {
MarkArea2DDataItemOption,
} from 'echarts/types/src/component/marker/MarkAreaModel';
import { MarkLine1DDataItemOption } from 'echarts/types/src/component/marker/MarkLineModel';
import { extractForecastSeriesContext } from '../utils/forecast';
import {
EchartsTimeseriesSeriesType,
@@ -144,6 +143,7 @@ export const getBaselineSeriesForStream = (
export function transformSeries(
series: SeriesOption,
colorScale: CategoricalColorScale,
colorScaleKey: string,
opts: {
area?: boolean;
filterState?: FilterState;
@@ -186,7 +186,6 @@ export function transformSeries(
showValueIndexes = [],
thresholdValues = [],
richTooltip,
seriesKey,
sliceId,
isHorizontal = false,
queryIndex = 0,
@@ -236,7 +235,7 @@ export function transformSeries(
}
// forcing the colorScale to return a different color for same metrics across different queries
const itemStyle = {
color: colorScale(seriesKey || forecastSeries.name, sliceId),
color: colorScale(colorScaleKey, sliceId),
opacity,
};
let emphasis = {};