diff --git a/src/features/history-chart/chartTypes.ts b/src/features/history-chart/chartTypes.ts index dd02491..ec9d243 100644 --- a/src/features/history-chart/chartTypes.ts +++ b/src/features/history-chart/chartTypes.ts @@ -1,6 +1,7 @@ export type AvgPointValue = [time: number, avg: number, min: number, max: number, count: number]; export type TooltipParam = { + color?: string; marker?: string; seriesName?: string; value?: unknown; diff --git a/src/features/history-chart/historyChartFormat.ts b/src/features/history-chart/historyChartFormat.ts index a86bfa0..aeb4a74 100644 --- a/src/features/history-chart/historyChartFormat.ts +++ b/src/features/history-chart/historyChartFormat.ts @@ -89,7 +89,7 @@ export function formatTooltip(params: unknown): string { const value = item.value as AvgPointValue; return [ '
', - `${item.marker ?? ''}${item.seriesName ?? ''}`, + `${item.seriesName ?? ''}`, '', `min ${formatChartValue(value[2])} · avg ${formatChartValue(value[1])} · max ${formatChartValue(value[3])}`, value[4] > 1 ? ` · ${value[4]} точек` : '', diff --git a/src/features/history-chart/historyChartOptions.ts b/src/features/history-chart/historyChartOptions.ts index 0ff826c..8a29bcd 100644 --- a/src/features/history-chart/historyChartOptions.ts +++ b/src/features/history-chart/historyChartOptions.ts @@ -45,6 +45,9 @@ export function createHistoryChartOptions({ legend: { type: 'scroll', top: 0, + icon: 'rect', + itemWidth: 18, + itemHeight: 3, data: legendData, textStyle: { color: '#cbd5e1' }, }, diff --git a/src/features/history-chart/historyChartSeries.ts b/src/features/history-chart/historyChartSeries.ts index 9637aab..325e82c 100644 --- a/src/features/history-chart/historyChartSeries.ts +++ b/src/features/history-chart/historyChartSeries.ts @@ -93,7 +93,11 @@ export function createSeriesOptions(points: HistoryPoint[], index: number, label color, }, emphasis: { - focus: 'series', + disabled: true, + lineStyle: { + width: 1.8, + color, + }, }, z: 3, }, diff --git a/src/styles/charts.css b/src/styles/charts.css index 66bcfc2..46f8a77 100644 --- a/src/styles/charts.css +++ b/src/styles/charts.css @@ -36,7 +36,7 @@ margin-top: 5px; } -.chart-tooltip-row span { +.chart-tooltip-label { min-width: 0; overflow: hidden; color: #cbd5e1; @@ -44,6 +44,16 @@ white-space: nowrap; } +.chart-tooltip-label::before { + content: ''; + display: inline-block; + width: 18px; + height: 3px; + margin-right: 6px; + vertical-align: middle; + background: var(--chart-tooltip-marker-color, currentColor); +} + .chart-tooltip-row strong { color: #f8fafc; font-variant-numeric: tabular-nums;