diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index a055dcac09..06297c2339 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -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], diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 4c18e8005d..cb3c10c344 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -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 // Fabien Lavocat @@ -586,6 +586,8 @@ declare namespace Chart { interface ChartDataSets { cubicInterpolationMode?: 'default' | 'monotone'; backgroundColor?: ChartColor | ChartColor[] | Scriptable; + barPercentage?: number; + barThickness?: number | "flex"; borderAlign?: BorderAlignment | BorderAlignment[] | Scriptable; borderWidth?: BorderWidth | BorderWidth[] | Scriptable; borderColor?: ChartColor | ChartColor[] | Scriptable; @@ -594,6 +596,7 @@ declare namespace Chart { borderDashOffset?: number; borderJoinStyle?: 'bevel' | 'round' | 'miter'; borderSkipped?: PositionType | PositionType[] | Scriptable; + categoryPercentage?: number; data?: Array | ChartPoint[]; fill?: boolean | number | string; hitRadius?: number | number[] | Scriptable; @@ -602,6 +605,8 @@ declare namespace Chart { hoverBorderWidth?: number | number[] | Scriptable; label?: string; lineTension?: number; + maxBarThickness?: number; + minBarLength?: number; steppedLine?: 'before' | 'after' | 'middle' | boolean; pointBorderColor?: ChartColor | ChartColor[] | Scriptable; pointBackgroundColor?: ChartColor | ChartColor[] | Scriptable; @@ -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'; }