1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-22 08:14:07 +02:00
This commit is contained in:
syuilo
2025-09-01 12:31:27 +09:00
parent 08ecf7ca79
commit d27c740ab0
6 changed files with 27 additions and 13 deletions

View File

@@ -6,9 +6,11 @@
import type { Plugin } from 'chart.js';
import MkChartLegend from '@/components/MkChartLegend.vue';
export const chartLegend = (legend: InstanceType<typeof MkChartLegend>) => ({
export const chartLegend = (legend: InstanceType<typeof MkChartLegend> | null | undefined) => ({
id: 'htmlLegend',
afterUpdate(chart, args, options) {
if (legend == null) return;
// Reuse the built-in legendItems generator
const items = chart.options.plugins!.legend!.labels!.generateLabels!(chart);