chartjs-plugin-colorschemes
chartjs-plugin-colorschemes copied to clipboard
Fix Chart.js v3 compatibility
Chart.js seems to use Chart.register
, while v2 uses Chart.plugins.register
.
This fixes registering the Color Schemes Plugin in Chart.js v3.
I think this is already covered by this one? https://github.com/nagix/chartjs-plugin-colorschemes/pull/26
@s4m0r4m4 #26 does not solve the problem addressed by this Pull Request.
While #26 fixes Chart.JS 3 compatibility of the beginUpdate
methode, this Pull Request fixes the plugin registration automatism.
Oh I see, you're right. @nagix any chance we can get eyes on this?
Any update on this @nagix ? We are looking to get on Chart.js v3 but right now this lib is preventing us from upgrading
Hi @nagix any news on this? would be good to get this out so that we can get colorscheme to work with v3 :)
looks like there is some more that needs to be fixed before you can use this with V3, in V3 the way of import Chart.js has changed with Treeshaking so import Chart from 'chart.js'
wont work. You need to use treeshaking to import it like so: import { Chart } from 'chart.js'
.
Also Chart.helpers
does not exist anymore. You need to import the specific helpers with treeshaking from 'chart.js/helpers'