chartjs-plugin-colorschemes icon indicating copy to clipboard operation
chartjs-plugin-colorschemes copied to clipboard

Fix Chart.js v3 compatibility

Open lars-sh opened this issue 3 years ago • 6 comments

Chart.js seems to use Chart.register, while v2 uses Chart.plugins.register. This fixes registering the Color Schemes Plugin in Chart.js v3.

lars-sh avatar Jul 13 '21 23:07 lars-sh

I think this is already covered by this one? https://github.com/nagix/chartjs-plugin-colorschemes/pull/26

s4m0r4m4 avatar Oct 05 '21 01:10 s4m0r4m4

@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.

lars-sh avatar Oct 05 '21 17:10 lars-sh

Oh I see, you're right. @nagix any chance we can get eyes on this?

s4m0r4m4 avatar Oct 05 '21 17:10 s4m0r4m4

Any update on this @nagix ? We are looking to get on Chart.js v3 but right now this lib is preventing us from upgrading

harrytalbot avatar Oct 22 '21 12:10 harrytalbot

Hi @nagix any news on this? would be good to get this out so that we can get colorscheme to work with v3 :)

choweiyuan avatar Oct 27 '21 09:10 choweiyuan

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'

LeeLenaleee avatar Dec 05 '21 20:12 LeeLenaleee