[Bug]: Type definition for ChartOptions
See original GitHub issueCurrent and expected behavior
I posted this issue in chart.js repo, but I think it is related to this lib and its type definitions.
With these options,
const options = {
scales: {
y: {
min: 0,
},
x: {
type: 'time', // << ts error
...
I got this error:
Type ‘string’ is not assignable to type ‘“timeseries” | undefined’.
So, I added as any (not ideal):
type: ‘time’ as any,
If there is a more correct way, I’d love to know.
Here’s my reproduction:
https://github.com/JBaczuk/chartjs-9085-repro
Reproduction
https://github.com/JBaczuk/chartjs-9085-repro
chart.js version
v3.7.0
react-chartjs-2 version
v4.0.0
Possible solution
unsure
Issue Analytics
- State:
- Created 2 years ago
- Comments:11
Top Results From Across the Web
Kendo, TypeScript definition bug: - Stack Overflow
When I do this, I get the following error, which seems to indicate that ChartOptions is expected to be an array: "Error 70...
Read more >Bug Types (Summary) - Test IO Academy
A bug is a software-related problem. If something on a website or in an application does not work as intended, this “error” is...
Read more >Highcharts TypeScript Declarations (beta)
Reporting Bugs# ... The TypeScript declarations for Highcharts are in a beta state. They can be used in production, but we can't guarantee...
Read more >Animations | Chart.js
Animation configuration consists of 3 keys. Name, Type, Details. animation, object, animation. animations, object, animations.
Read more >Reporting defects in Agile Development 2.0 - ServiceNow Docs
Define a new planning item type in Alignment Planner Workspace ... Create a task from an incident, problem, or change request ... Gantt...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JBaczuk More stable variant is define type of options explicitly:
@JBaczuk I tried it, all works without issues https://codesandbox.io/s/nifty-water-03zp6?file=/App.tsx