My current settings are as follows:
export const options = {
responsive: true,
scales: {
x: {
ticks: {
maxTicksLimit: 10,
autoSkip: true,
color: 'white',
},
type: 'time',
adapters: {
date: {
locale: enGB,
},
},
},
y: {
ticks: {
color: 'white',
},
},
},
plugins: {
legend: {
display: false,
},
title: {
display: true,
text: 'IndexCoin Price',
color: 'white',
},
},
}
I incorporate these settings in the following code snippet:
<Line options={options} data={dataSets} />
In this line of code, Visual Studio Code highlights the first occurrence of options with the following error:
"min" | "max"> & { min: string | number; max: string | number; suggestedMin: string | number; ... 4 more ...; ticks: { ...; }; }> | ... 4 more ... | undefined'.
Type '{ ticks: { maxTicksLimit: number; autoSkip: boolean; color: string; }; type: string; adapters: { date: { locale: Locale; }; }; }' is not assignable to type '_DeepPartialObject<{ type: "timeseries"; } & Omit<CartesianScaleOptions, "min" | "max"> & { min: string | number; max: string | number; suggestedMin: string | number; ... 4 more ...; ticks: { ...; }; }>'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"timeseries"'.ts(2322)
types.d.ts(19, 5): The expected type comes from property 'options' which is declared here on type 'IntrinsicAttributes & Omit<ChartProps<"line", number[], Date>, "type"> & { ref?: ForwardedRef<ChartJSOrUndefined<"line", number[], Date>> | undefined; }'
This issue disappears when I remove type: 'time'
from options. Despite the error, the code functions correctly. Can anyone explain why this error occurs?