Open DmytroLitvinov opened 3 years ago
I will update the build system, workflows and documentation, add TypeScript support, improve ES module support, then release v1 😉
When we will can get the new release for chartjs v3?
What is the latest Chart.js compatible version? I'm building a Flask application and my charts go all grey when I use any version of Chart.js after 2.9.4. Thanks 😀
I was playing a bit with colorscheme v0.4.0 + Chart.js, and until v2.9.4 the plugin seems to work, but for newer versions (+3.0.2), colorscheme is broken with the following error:
Uncaught TypeError: f.defaults.global is undefined
<anonymous> https://cdn.jsdelivr.net/npm/chartjs-plugin-colorschemes@0.4.0:7
<anonymous> https://cdn.jsdelivr.net/npm/chartjs-plugin-colorschemes@0.4.0:7
<anonymous> https://cdn.jsdelivr.net/npm/chartjs-plugin-colorschemes@0.4.0:7
@nagix Any idea of a release date for v1?
Hello! Master branch does not work with Chart.js 3.5.1 I've correct plugin.colorschemes.js, line 184 Replace Chart.plugins.register(ColorSchemesPlugin); to (Chart.plugins || Chart).register(ColorSchemesPlugin); After this replacement chartjs-plugin-colorschemes works well with Chart.js 3.5.1
Hi. I think it's not enough:
Uncaught TypeError: Chart.defaults.global is undefined
I encountered the same same issues. I was able to get it working with chart.js 3.5.1 by applying the above patch, but also: Line 1040 change: Chart.defaults.global.plugins.colorschemes to Chart.defaults.plugins.colorschemes
Line 1075 - beforeUpdate: added following new line to get plugin options from chart object (as they were not present in argument options): var options = chart.config.options.plugins.colorschemes;
Also replace Chart.plugins.register(ColorSchemesPlugin);
with Chart.register(ColorSchemesPlugin);
on line 1189
@nagix With #26, it's technically not a breaking change as far as I know. Would you consider releasing a 0.5.0 for Chart.js 3 compatibility? I know it would be nice to bundle this update into the v1.0 release, but perhaps it's just time to get Chart.js 3 support out there.
I think this may help resolve ChartJs 3 compatibility: https://github.com/nagix/chartjs-plugin-colorschemes/pull/30, check it out and make sure it's working!
I think there is one more problem with the typ 'bar'.
in beforeUpdate the forEach which should set scheme colors, it set only the first color
@nagix do you have any idea when the next release can be released with compatibility with chart.js 3.X.X ? Thanks
Sorry for insisting, @nagix do you know when you have time for a new release? :smile:
Hello @nagix if you no more have time, perhaps you can add one or two people with write access to this repo, that make update alive :-)
"I will update the build system, workflows and documentation, add TypeScript support, improve ES module support, then release v1" Will it be done in 2022 ? at least support for v3... thanks
@nagix Any idea of a release date for v1? Supporting Chart.js V3 becomes important for many projects and avoid using this plugin for compatibility problem is wasted your work,
just a 👍 for your great work combined with a tiny
please release V3 support
In issue #33 jayantbh has written
https://www.npmjs.com/package/hw-chartjs-plugin-colorschemes
This seems to be a fork published to work with chartjs v3.
Indeed, this fork works with ChartJS 3.x, but has another bug.
If I use this ChartJS config
{
type: 'bar',
data: {
labels: ['diagramLabel'],
datasets: [{
label: 'dataLabel',
data: [1],
backgroundColor: '#00FF00'
}]
},
options: {
plugins: {
colorschemes: {
scheme: 'brewer.YlGn3'
}
}
}
}
the resulting data bar has not the configured background-color #00FF00
. It displays it in some "light yellow". If i remove the options section (the colorscheme configuration) then it uses some other color ("light blue"), but still not #00FF00
.
Can someone reproduce and confirm it?
In ChartJS 2.x with the unpatched colorscheme-plugin it works.
After merging https://github.com/nagix/chartjs-plugin-colorschemes/pull/26 it would be nice to see it as npm package's release :)