private getLegendValueColor(seriesId: string, strategy: SeriesStrategies, time?: Time): string {
const defaultColor = this.legendSeriesColors.get(seriesId) ?? strategy.getLegendColor(time) ?? '';
if (this.id !== IndicatorsIds.vol || seriesId !== 'volume') {
return defaultColor;
}
const point = this.mainSeriesRef.value?.getDataItemByTime(time) as
| {
open?: number;
close?: number;
customValues?: {
open?: number;
close?: number;
};
}
| null;
const open = point?.open ?? point?.customValues?.open;
const close = point?.close ?? point?.customValues?.close;
if (open == null || close == null) {
return defaultColor;
}
const { colors } = getThemeStore();
return close >= open ? colors.chartCandleUp : colors.chartCandleDown;
}