fix: use annotation's saved color for TrendLine instead of annotationType default color

This commit is contained in:
Marko Djordjevic 2026-02-17 20:03:54 +01:00
parent c404e79678
commit 7901a1a257

View file

@ -30,6 +30,7 @@ interface Annotation {
id: number;
timestamp: number;
label_type: string;
color: string | null;
geometry: {
startTime?: number;
startPrice?: number;
@ -1087,7 +1088,7 @@ const CandleChart = forwardRef<CandleChartHandle, CandleChartProps>(
price: geometry.endPrice!,
};
const color = annotationTypes.find((t) => t.name === 'line')?.color || selectedColor;
const color = annotation.color || annotationTypes.find((t) => t.name === 'line')?.color || selectedColor;
const trendLine = new TrendLine(
chartRef.current!,