Add a property in ChartOptions
See original GitHub issueHi!
Is it possible to add:
annotation?: object
property in @types/chart.js inside ChartOptions interface?
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Options | Chart.js
Options. # Option resolution. Options are resolved from top to bottom, using a context dependent route. # Chart level options.
Read more >Chart.options returns "Property 'options' does not exist on type ...
Got it working. I do not know exactly what was causing this error however by treating the properties as array elements I was...
Read more >Customizing Chart using Chart Options - CanvasJS.com
You can set data and all the attributes/properties of a chart using chart option object. You can pass the chart “options” as a...
Read more >ChartJS Tutorials #4 - Chart Options - YouTube
In this video, we explore chart options in ChartJS. Subscribe for more free tutorials https://goo.gl/6ljoFc, Buy this series and get access ...
Read more >Getting Started - vue-chartjs
pnpm add vue-chartjs chart.js # or yarn add vue-chartjs chart.js # or npm i ... <template> <Bar id="my-chart-id" :options="chartOptions" ...
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
@etimberg Thank you for the lead, a further investigation and I’ve found the magic formula, I’ve added:
to devDependencies, instead of dependencies, and that did the trick.
Thanks again
Ah, ok, you’re using v2.9.4 + the DefinitelyTyped definitions? My suggestion should work v3.0.0-beta.4 where we’ve shipped the types from our repo.
I’m not sure what the best way to augment those types would be. It looks like you’d want to augment
ChartOptions
instead ofIChartOptions
but I’m not sure what other changes might be required. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chart.js/index.d.ts#L285The DefinitelyTyped definitions for the annotation plugin augment
ChartOptions
using https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chartjs-plugin-annotation/index.d.ts#L11-L23