1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-26 07:54:13 +02:00
This commit is contained in:
syuilo
2025-08-26 09:39:23 +09:00
parent 9e5c8d94bf
commit dbb6c71c5c
8 changed files with 51 additions and 35 deletions

View File

@@ -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;