mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-22 08:14:07 +02:00
refactor
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user