Добавил возможность выбора множества тегов для отображения.

This commit is contained in:
Первов Артем
2026-06-22 21:49:52 +03:00
parent 6ab9cd1c75
commit 9fc66624dc
10 changed files with 229 additions and 109 deletions

View File

@@ -1,29 +1,27 @@
import type { EChartsOption } from 'echarts';
import type { HistoryResponse } from '../../entities/history/types';
import type { SeriesOption } from 'echarts';
import type { HistoryAxisLabelFormat } from '../../utils/historyGranularity';
import type { DataZoomState } from './chartTypes';
import { formatAxisDate, formatTooltip } from './historyChartFormat';
import { createSeriesOptions, SERIES_COLORS } from './historyChartSeries';
import { SERIES_COLORS } from './historyChartSeries';
export type HistoryChartOptionsInput = {
data?: HistoryResponse;
dataZoomState: DataZoomState;
from?: string;
to?: string;
labelFormat?: HistoryAxisLabelFormat;
legendData: string[];
seriesLabel: string;
series: SeriesOption[];
tickIntervalMs?: number;
};
export function createHistoryChartOptions({
data,
dataZoomState,
from,
to,
labelFormat,
legendData,
seriesLabel,
series,
tickIntervalMs,
}: HistoryChartOptionsInput): EChartsOption {
const xMin = from ? new Date(from).getTime() : undefined;
@@ -102,6 +100,6 @@ export function createHistoryChartOptions({
endValue: dataZoomState.endValue,
},
],
series: data?.rows.length ? createSeriesOptions(data.rows, 0, seriesLabel) : [],
series,
};
}