Chart.js 3.0.0-rc.5: Plugins are not registered correctly if used for specific chart instances.
See original GitHub issueExpected Behavior
I expect to be able to specify a plugin for a specific chart instance without having to register it globally
Current Behavior
Plugin is not effective. Not all plugin lifecycle events seem to be called when adding a plugin to a specific chart instance.
Steps to Reproduce
https://codepen.io/santa-85/pen/BaQgqYe?editors=1111
To see correct behaviour, add chartjsPluginAnnotation
to the Chart.register
call
Environment
- Chart.js version: 3.0.0-rc.5
- Link to your project: https://github.com/valor-software/ng2-charts/pull/1276
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Plugins | Chart.js
Plugins can be registered globally to be applied on all charts (a.k.a. global ... To disable a global plugin for a specific chart...
Read more >Troubleshooting in Athena - AWS Documentation
When you use a CTAS statement to create a table with more than 100 partitions, ... Athena does not support querying the data...
Read more >1. How to add chartjs-plugin-datalabels to Chart.JS - YouTube
JS 3.0 we can expect more new exciting charts in the near future. About Chart. JS 3 | Chart JS 3 Chart JS...
Read more >Dynamically update values of a chartjs chart - Stack Overflow
Update: Looks like chartjs has been updated (see comment below). There are some examples up that look very nice: Here's an example of...
Read more >Migration | chartjs-plugin-streaming - nagix
import {Chart} from 'chart.js'; import ChartStreaming from 'chartjs-plugin-streaming'; Chart.register(ChartStreaming); ...
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
I added some more documentation on the plugin hooks and added some flow charts on how create/update work. There are other hooks (start/stop) that get called for all plugins on a per-chart basis when a plugin is added/removed from the chart instance.
This specific issue with the annotation plugin is because it was never written to handle being applied inline. Depending on the plugin, and what is needs to do, inline can make sense. For example, a plugin to draw the framerate of the chart animations could likely be done with no options, defaults, or registered elements so adding inline is totally fine.
@etimberg I started testing this only since the first rc version, but I suspect it was there for a while.