Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions types/index.esm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3088,7 +3088,7 @@ export interface CartesianScaleOptions extends CoreScaleOptions {
};
}

export type CategoryScaleOptions = CartesianScaleOptions & {
export type CategoryScaleOptions = Omit<CartesianScaleOptions, 'min' | 'max'> & {
min: string | number;
max: string | number;
labels: string[] | string[][];
Expand All @@ -3107,7 +3107,6 @@ export type LinearScaleOptions = CartesianScaleOptions & {
* @default true
*/
beginAtZero: boolean;

/**
* Adjustment used when calculating the maximum data value.
*/
Expand Down Expand Up @@ -3151,7 +3150,6 @@ export const LinearScale: ChartComponent & {
};

export type LogarithmicScaleOptions = CartesianScaleOptions & {

/**
* Adjustment used when calculating the maximum data value.
*/
Expand All @@ -3175,10 +3173,9 @@ export const LogarithmicScale: ChartComponent & {
new <O extends LogarithmicScaleOptions = LogarithmicScaleOptions>(cfg: AnyObject): LogarithmicScale<O>;
};

export type TimeScaleOptions = CartesianScaleOptions & {
export type TimeScaleOptions = Omit<CartesianScaleOptions, 'min' | 'max'> & {
min: string | number;
max: string | number;

suggestedMin: string | number;
suggestedMax: string | number;
/**
Expand Down
30 changes: 30 additions & 0 deletions types/tests/scales/time_string_max.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Chart } from '../../index.esm';

const chart = new Chart('id', {
type: 'line',
data: {
datasets: [
{
label: 'Pie',
data: [
],
borderColor: '#000000',
backgroundColor: '#00FF00'
}
]
},
options: {
scales: {
x: {
type: 'time',
min: '2021-01-01',
max: '2021-12-01'
},
y: {
type: 'linear',
min: 0,
max: 10
}
}
}
});