mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Types: fix bubble chart options (#8625)
This commit is contained in:
parent
49b902aeab
commit
aee979da54
@ -1,25 +0,0 @@
|
||||
import {Chart, IBarControllerConfiguration} from '../..';
|
||||
|
||||
const bar = new Chart(document.createElement('canvas'), {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['A', 'B'],
|
||||
datasets: [
|
||||
{
|
||||
data: [1,2],
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const barTyped = new Chart<number, string, IBarControllerConfiguration<number, string>>(document.createElement('canvas'), {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['A', 'B'],
|
||||
datasets: [
|
||||
{
|
||||
data: [1,2],
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
4
types/index.esm.d.ts
vendored
4
types/index.esm.d.ts
vendored
@ -3184,7 +3184,7 @@ export interface ChartTypeRegistry {
|
||||
scales: keyof CartesianScaleTypeRegistry;
|
||||
};
|
||||
bubble: {
|
||||
chartOptions: EmptyObject;
|
||||
chartOptions: unknown;
|
||||
datasetOptions: BubbleControllerDatasetOptions;
|
||||
defaultDataPoint: BubbleDataPoint;
|
||||
parsedDataType: BubbleParsedData;
|
||||
@ -3268,7 +3268,7 @@ export interface ChartData<
|
||||
TData = DefaultDataPoint<TType>,
|
||||
TLabel = unknown
|
||||
> {
|
||||
labels: TLabel[];
|
||||
labels?: TLabel[];
|
||||
datasets: ChartDataset<TType, TData>[];
|
||||
}
|
||||
|
||||
|
22
types/tests/controllers/bubble_chart_options.ts
Normal file
22
types/tests/controllers/bubble_chart_options.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { Chart, ChartOptions } from '../../index.esm';
|
||||
|
||||
const chart = new Chart('test', {
|
||||
type: 'bubble',
|
||||
data: {
|
||||
datasets: []
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
x: {
|
||||
min: 0,
|
||||
max: 30,
|
||||
ticks: {}
|
||||
},
|
||||
y: {
|
||||
min: 0,
|
||||
max: 30,
|
||||
ticks: {},
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user