@types/chart.js: Fix barThickness deprecation warning (#40333)

* @types/chart.js: Fix barThickness deprecation warning

* @types/chart.js: Fix maxBarThickness deprecation warning

* @types/chart.js: Fix additional deprecation warnings
This commit is contained in:
Martin
2019-11-13 15:11:02 -08:00
committed by Pranav Senthilnathan
parent 16475983d9
commit dca36de633
2 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -29,6 +29,8 @@ const chart: Chart = new Chart(ctx, {
borderWidth: { top: 1, right: 1, bottom: 0, left: 1 },
label: 'test',
data: [1, 3, 5],
barThickness: 'flex',
minBarLength: 2,
}
],
},
@@ -67,7 +69,6 @@ const chart: Chart = new Chart(ctx, {
ticks: {
callback: Math.floor,
},
minBarLength: 2,
gridLines: {
display: false,
borderDash: [5, 15],
+6 -6
View File
@@ -1,4 +1,4 @@
// Type definitions for Chart.js 2.8
// Type definitions for Chart.js 2.9
// Project: https://github.com/nnnick/Chart.js, https://www.chartjs.org
// Definitions by: Alberto Nuti <https://github.com/anuti>
// Fabien Lavocat <https://github.com/FabienLavocat>
@@ -586,6 +586,8 @@ declare namespace Chart {
interface ChartDataSets {
cubicInterpolationMode?: 'default' | 'monotone';
backgroundColor?: ChartColor | ChartColor[] | Scriptable<ChartColor>;
barPercentage?: number;
barThickness?: number | "flex";
borderAlign?: BorderAlignment | BorderAlignment[] | Scriptable<BorderAlignment>;
borderWidth?: BorderWidth | BorderWidth[] | Scriptable<BorderWidth>;
borderColor?: ChartColor | ChartColor[] | Scriptable<ChartColor>;
@@ -594,6 +596,7 @@ declare namespace Chart {
borderDashOffset?: number;
borderJoinStyle?: 'bevel' | 'round' | 'miter';
borderSkipped?: PositionType | PositionType[] | Scriptable<PositionType>;
categoryPercentage?: number;
data?: Array<number | null | undefined> | ChartPoint[];
fill?: boolean | number | string;
hitRadius?: number | number[] | Scriptable<number>;
@@ -602,6 +605,8 @@ declare namespace Chart {
hoverBorderWidth?: number | number[] | Scriptable<number>;
label?: string;
lineTension?: number;
maxBarThickness?: number;
minBarLength?: number;
steppedLine?: 'before' | 'after' | 'middle' | boolean;
pointBorderColor?: ChartColor | ChartColor[] | Scriptable<ChartColor>;
pointBackgroundColor?: ChartColor | ChartColor[] | Scriptable<ChartColor>;
@@ -647,9 +652,6 @@ declare namespace Chart {
position?: string;
ticks?: TickOptions;
gridLines?: GridLineOptions;
barThickness?: number | "flex";
maxBarThickness?: number;
minBarLength?: number;
scaleLabel?: ScaleTitleOptions;
time?: TimeScale;
offset?: boolean;
@@ -670,8 +672,6 @@ declare namespace Chart {
}
interface ChartXAxe extends CommonAxe {
categoryPercentage?: number;
barPercentage?: number;
distribution?: 'linear' | 'series';
}