fix(plugin-chart-echarts): [feature parity] annotation line chart color not working (#19758)

This commit is contained in:
Stephen Liu 2022-04-29 00:10:58 +08:00 committed by GitHub
parent d5ea537b0e
commit 11562971fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -236,6 +236,8 @@ export default function transformProps(
markerSize,
data1,
annotationData,
colorScale,
sliceId,
),
);
}

View File

@ -259,6 +259,8 @@ export default function transformProps(
markerSize,
data,
annotationData,
colorScale,
sliceId,
),
);
}

View File

@ -418,9 +418,11 @@ export function transformTimeseriesAnnotation(
markerSize: number,
data: TimeseriesDataRecord[],
annotationData: AnnotationData,
colorScale: CategoricalColorScale,
sliceId?: number,
): SeriesOption[] {
const series: SeriesOption[] = [];
const { hideLine, name, opacity, showMarkers, style, width } = layer;
const { hideLine, name, opacity, showMarkers, style, width, color } = layer;
const result = annotationData[name];
if (isTimeseriesAnnotationResult(result)) {
result.forEach(annotation => {
@ -435,6 +437,7 @@ export function transformTimeseriesAnnotation(
opacity: parseAnnotationOpacity(opacity),
type: style as ZRLineType,
width: hideLine ? 0 : width,
color: color || colorScale(name, sliceId),
},
});
});