mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
fix(chart.js): add missing ChartTooltipItem fields (#36611)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
0adb4909e9
commit
ac1869e78d
@@ -46,7 +46,14 @@ const chart: Chart = new Chart(ctx, {
|
||||
caretPadding: 2,
|
||||
displayColors: true,
|
||||
borderColor: "rgba(0,0,0,0)",
|
||||
borderWidth: 1
|
||||
borderWidth: 1,
|
||||
callbacks: {
|
||||
title: ([point]) => point.label ? point.label.substring(0, 2) : 'title',
|
||||
label(tooltipItem) {
|
||||
const { value, x, y, label } = tooltipItem;
|
||||
return `${label}(${x}, ${y}) = ${value}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
scales: {
|
||||
xAxes: [
|
||||
|
||||
Vendored
+4
@@ -154,10 +154,14 @@ declare namespace Chart {
|
||||
}
|
||||
|
||||
interface ChartTooltipItem {
|
||||
label?: string;
|
||||
value?: string;
|
||||
xLabel?: string | number;
|
||||
yLabel?: string | number;
|
||||
datasetIndex?: number;
|
||||
index?: number;
|
||||
x?: number;
|
||||
y?: number;
|
||||
}
|
||||
|
||||
interface ChartTooltipLabelColor {
|
||||
|
||||
Reference in New Issue
Block a user