Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Release with compatibility Chart.js v3 #28

Open
DmytroLitvinov opened this issue Jun 14, 2021 · 25 comments
Open

New Release with compatibility Chart.js v3 #28

DmytroLitvinov opened this issue Jun 14, 2021 · 25 comments
Assignees
Milestone

Comments

@DmytroLitvinov
Copy link

After merging #26 it would be nice to see it as npm package's release :)

@nagix nagix self-assigned this Jun 14, 2021
@nagix nagix added this to the v1.0.0 milestone Jun 14, 2021
@nagix
Copy link
Owner

nagix commented Jun 14, 2021

I will update the build system, workflows and documentation, add TypeScript support, improve ES module support, then release v1 😉

@marti1125
Copy link

When we will can get the new release for chartjs v3?

@matheusft
Copy link

matheusft commented Jul 7, 2021

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 😀

@berthin
Copy link

berthin commented Jul 18, 2021

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/[email protected]:7
    <anonymous> https://cdn.jsdelivr.net/npm/[email protected]:7
    <anonymous> https://cdn.jsdelivr.net/npm/[email protected]:7

@drkelly58
Copy link

@nagix Any idea of a release date for v1?

@yurij7070
Copy link

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

efokschaner added a commit to efokschaner/chartjs-plugin-colorschemes that referenced this issue Sep 17, 2021
@Cyrille37
Copy link

Hi.
I think it's not enough:

Uncaught TypeError: Chart.defaults.global is undefined

@it-mkl
Copy link

it-mkl commented Sep 30, 2021

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;

@pizzo00
Copy link

pizzo00 commented Sep 30, 2021

Also replace Chart.plugins.register(ColorSchemesPlugin); with Chart.register(ColorSchemesPlugin); on line 1189

@s4m0r4m4
Copy link

s4m0r4m4 commented Oct 5, 2021

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

@s4m0r4m4
Copy link

s4m0r4m4 commented Oct 5, 2021

I think this may help resolve ChartJs 3 compatibility: #30, check it out and make sure it's working!

@ger82
Copy link

ger82 commented Nov 24, 2021

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

LeeLenaleee added a commit to LeeLenaleee/awesome that referenced this issue Dec 5, 2021
Colorschemes plugin is not compattible with V3.

Issue about it: nagix/chartjs-plugin-colorschemes#28
Open PR for improving V3 compatability: nagix/chartjs-plugin-colorschemes#30
kurkle pushed a commit to chartjs/awesome that referenced this issue Dec 6, 2021
Colorschemes plugin is not compattible with V3.

Issue about it: nagix/chartjs-plugin-colorschemes#28
Open PR for improving V3 compatability: nagix/chartjs-plugin-colorschemes#30
@nicohlr
Copy link

nicohlr commented Jan 4, 2022

@nagix do you have any idea when the next release can be released with compatibility with chart.js 3.X.X ? Thanks

@viktorsmari
Copy link

Sorry for insisting, @nagix do you know when you have time for a new release? 😄

@Cyrille37
Copy link

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 :-)

@devozanges
Copy link

devozanges commented Jan 27, 2022

"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

@sdespont
Copy link

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

@simonbuehler
Copy link

just a 👍 for your great work combined with a tiny

please release V3 support

@tl-sfo
Copy link

tl-sfo commented Dec 1, 2022

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.

@dregad
Copy link

dregad commented Oct 12, 2024

It's been nearly 2 years since the last post in this Issue, and sadly still no new official release of this great plugin with ChartJS 3 support on the horizon 😞

@nagix is there any chance for that to ever happen ? If you don't have time or motivation to continue maintaining this that's perfectly fine and understandable (and thank you for your work !), but in that case maybe you would consider granting write access to this repo to one or more people so it can be kept alive, or transfer ownership to someone who is willing to take over its maintenance ?

I noticed several forks which claim support for v3 but they are diverging so I'm not sure which one I should use (I need CDN too)... It would be awesome if they could be unified @MaximBelov @zsu @m08pvv

@MaximBelov
Copy link

MaximBelov commented Oct 12, 2024

@dregad
please check my version
https://www.npmjs.com/package/hw-chartjs-plugin-colorschemes

Install

npm i hw-chartjs-plugin-colorschemes --save

Let me know about any issues

Changes
MaximBelov@fb1e919

@dregad
Copy link

dregad commented Oct 12, 2024

please check my version

Thank you, I upgraded my code to use chart.js 3.9.1 + hw-chartjs-plugin-colorschemes 0.5.4, and it seems to work fine overall.

I just have a regression compared to my legacy 2.9.4 / 0.4.0 code, but to avoid highjacking this thread and for lack of a better place to report issues, I have opened #41: custom backgroundColor on a pie chart's datasets are ignored.

@MaximBelov
Copy link

Use version 0.6.1+ for charts.js v4+

@dregad
Copy link

dregad commented Oct 12, 2024

Thank you @MaximBelov ❤️ !

May I suggest to create Git tags at

NOTE: v0.6.0 tag at bea237c is incorrect, that's actually v0.6.1... v0.6.0 should be fb1e919. the Release is wrong, too.

It would be useful as well, to have Releases with a brief description indicating the change in chart.js support (v0.5.4 for 3.x, v0.6.1 for 4.x).

Thanks again !

@MaximBelov
Copy link

@dregad

No problems
Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests