mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
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:
parent
0c51ecd451
commit
21305e2883
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@ -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;
|
||||
|
11
types/tests/controllers/bar_floating_data.ts
Normal file
11
types/tests/controllers/bar_floating_data.ts
Normal 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]]
|
||||
}]
|
||||
},
|
||||
});
|
Loading…
Reference in New Issue
Block a user