@opendatasoft/visualizations
Version:
Opendatasoft's components to easily build dashboards and visualizations.
23 lines (22 loc) • 828 B
TypeScript
import type { LegendOptions, ChartConfiguration, Chart } from 'chart.js';
import type { _DeepPartialObject } from 'chart.js/dist/types/utils';
import type { ChartOptions } from './types';
export declare function buildLegend(options: ChartOptions): _DeepPartialObject<LegendOptions<"pie">>;
export declare function buildPieAndDoughnutCustomLegend({ chart, options, chartConfig, }: {
chart: Chart;
options: ChartOptions;
chartConfig: ChartConfiguration;
}): {
type: "category";
position: "bottom" | "left" | "right";
align: "start" | "center" | "end";
items: {
color: string;
variant: "box";
dashed: boolean;
label: string;
onClick: (index: number) => void;
onHover: (index: number, isVisible?: boolean) => void;
onLeave: () => void;
}[];
};