diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-26 09:39:23 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-26 09:39:23 +0900 |
| commit | dbb6c71c5c7098c33824b6070b6526416d3bdd69 (patch) | |
| tree | 56a647059e9f18b62d71a4a774ac66be347e194e /packages/frontend/src/utility/chart-vline.ts | |
| parent | refactor (diff) | |
| download | misskey-dbb6c71c5c7098c33824b6070b6526416d3bdd69.tar.gz misskey-dbb6c71c5c7098c33824b6070b6526416d3bdd69.tar.bz2 misskey-dbb6c71c5c7098c33824b6070b6526416d3bdd69.zip | |
refactor
Diffstat (limited to 'packages/frontend/src/utility/chart-vline.ts')
| -rw-r--r-- | packages/frontend/src/utility/chart-vline.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/frontend/src/utility/chart-vline.ts b/packages/frontend/src/utility/chart-vline.ts index 465ca591c6..2fe4bdb83b 100644 --- a/packages/frontend/src/utility/chart-vline.ts +++ b/packages/frontend/src/utility/chart-vline.ts @@ -8,9 +8,10 @@ import type { Plugin } from 'chart.js'; export const chartVLine = (vLineColor: string) => ({ id: 'vLine', beforeDraw(chart, args, options) { - if (chart.tooltip?._active?.length) { + const tooltip = chart.tooltip as any; + if (tooltip?._active?.length) { const ctx = chart.ctx; - const xs = chart.tooltip._active.map(a => a.element.x); + const xs = tooltip._active.map(a => a.element.x); const x = xs.reduce((a, b) => a + b, 0) / xs.length; const topY = chart.scales.y.top; const bottomY = chart.scales.y.bottom; |