mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
[chart.js] Add missing legend label configuration options (#23157)
This commit is contained in:
@@ -45,7 +45,14 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), {
|
||||
}
|
||||
}]
|
||||
},
|
||||
plugins: { arbitraryPlugin: {option: "value"} }
|
||||
plugins: { arbitraryPlugin: {option: "value"} },
|
||||
legend: {
|
||||
display: true,
|
||||
labels: {
|
||||
usePointStyle: true,
|
||||
padding: 40
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
chart.update();
|
||||
|
||||
4
types/chart.js/index.d.ts
vendored
4
types/chart.js/index.d.ts
vendored
@@ -8,6 +8,7 @@
|
||||
// Joseph Page <https://github.com/josefpaij>
|
||||
// Dan Manastireanu <https://github.com/danmana>
|
||||
// Guillaume Rodriguez <https://github.com/guillaume-ro-fr>
|
||||
// Sergey Rubanov <https://github.com/chicoxyzzy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -119,6 +120,7 @@ declare namespace Chart {
|
||||
lineJoin?: string;
|
||||
lineWidth?: number;
|
||||
strokeStyle?: string;
|
||||
pointStyle?: PointStyle;
|
||||
}
|
||||
|
||||
interface ChartTooltipItem {
|
||||
@@ -231,6 +233,8 @@ declare namespace Chart {
|
||||
fontFamily?: string;
|
||||
padding?: number;
|
||||
generateLabels?(chart: any): any;
|
||||
filter?(item: ChartLegendItem, data: ChartData): any;
|
||||
usePointStyle?: boolean;
|
||||
}
|
||||
|
||||
interface ChartTooltipOptions {
|
||||
|
||||
Reference in New Issue
Block a user