Types: fix bubble chart options (#8625)

This commit is contained in:
Jukka Kurkela 2021-03-13 15:04:59 +02:00 committed by GitHub
parent 49b902aeab
commit aee979da54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 27 deletions

View File

@ -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],
}
]
}
});

View File

@ -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>[];
}

View 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: {},
},
}
}
});