Update bar data type to comply with floating bar charts data (#10652)

* Update index.d.ts

Floating bars charts can take an array of array.
https://www.chartjs.org/docs/latest/samples/bar/floating.html

* Update types/index.d.ts

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>

* floating bar chart data validation

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
This commit is contained in:
Lonylis 2022-09-06 09:42:04 -04:00 committed by GitHub
parent 0c51ecd451
commit 21305e2883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

2
types/index.d.ts vendored
View File

@ -3503,7 +3503,7 @@ export interface ChartTypeRegistry {
bar: {
chartOptions: BarControllerChartOptions;
datasetOptions: BarControllerDatasetOptions;
defaultDataPoint: number | null;
defaultDataPoint: number | [number, number] | null;
metaExtensions: {};
parsedDataType: BarParsedData,
scales: keyof CartesianScaleTypeRegistry;

View File

@ -0,0 +1,11 @@
import { Chart } from '../../../src/types';
const chart = new Chart('id', {
type: 'bar',
data: {
labels: ['1', '2', '3'],
datasets: [{
data: [[1, 2], [3, 4], [5, 6]]
}]
},
});