blob: 9447bd4767e8978b9b364efa235a4907409ee053 [file] [log] [blame]
import type { Chart, ChartType, Plugin, UpdateMode } from "chart.js";
export interface LegendOptions {
'onUpdate'?: (chart: Chart) => void;
}
export const LegendPlugin: Plugin<ChartType, LegendOptions> = {
id: 'benchmark',
afterUpdate: (chart: Chart, args: { mode: UpdateMode }, options: LegendOptions) => {
if (options.onUpdate) {
options.onUpdate(chart);
}
}
};