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

reset the default color to series #6138

Closed
crh225 opened this issue Dec 13, 2016 · 14 comments
Closed

reset the default color to series #6138

crh225 opened this issue Dec 13, 2016 · 14 comments
Assignees
Milestone

Comments

@crh225
Copy link

@crh225 crh225 commented Dec 13, 2016

Expected behaviour

when I clear all series, then add a new series, it should start over on the colors.
It says I can do chart.counters.color = 0; but counters in not in the latest typings for highcharts.

Actual behaviour

similar issue to #203

Affected browser(s)

all

@oysteinmoseng
Copy link
Member

@oysteinmoseng oysteinmoseng commented Dec 14, 2016

There is a chart.colorCounter, see http://jsfiddle.net/1ok4oege/.

Not sure how we should handle this automatically, as we can't just decrement this every time we remove a series, in case the series is not the last one, or there are custom colors on the series.

@crh225
Copy link
Author

@crh225 crh225 commented Dec 14, 2016

That link does not use rulings from the definabtly types project for highcharts.

@crh225
Copy link
Author

@crh225 crh225 commented Dec 14, 2016

That link does not use typings*

@havgry
Copy link

@havgry havgry commented Dec 14, 2016

As far as I can see counters is no longer part of the chart object and probably hasn't been for a while.

Regarding typings you're welcome to create a pull request with the addition of colorCounter but that's a different repository: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/highcharts

@crh225
Copy link
Author

@crh225 crh225 commented Dec 14, 2016

I realize it's a different repository but isn't highcharts responsible for their own typings?

@crh225
Copy link
Author

@crh225 crh225 commented Dec 14, 2016

Couldn't when it goes and gets the next chart series color, it does a check that says: if (series.length === 0) { chart.counter = 0;}

@oysteinmoseng
Copy link
Member

@oysteinmoseng oysteinmoseng commented Dec 14, 2016

We are not behind the DefinitelyTyped project for Highcharts, this is a 3rd party project.

Regarding chart.colorCounter = 0, this is something we could perhaps consider? @TorsteinHonsi comments?

@crh225
Copy link
Author

@crh225 crh225 commented Jan 4, 2017

@oysteinmoseng, @TorsteinHonsi, have you guys any update on this?

@oysteinmoseng
Copy link
Member

@oysteinmoseng oysteinmoseng commented Jan 5, 2017

We now reset the counter for the color and marker symbols whenever all series are removed. Hopefully this solves your problem.

@crh225
Copy link
Author

@crh225 crh225 commented Jan 5, 2017

@oysteinmoseng it solves it! what version of highcharts will this be released in?

@oysteinmoseng
Copy link
Member

@oysteinmoseng oysteinmoseng commented Jan 6, 2017

@crh225 This will be part of the next maintenance release, v5.0.7

@oysteinmoseng oysteinmoseng added this to the 5.0.7 milestone Jan 6, 2017
@crh225
Copy link
Author

@crh225 crh225 commented Jan 9, 2017

Thanks!

@crh225
Copy link
Author

@crh225 crh225 commented Jan 9, 2017

@oysteinmoseng , I tried to update to 5.0.7, but it cannot find it (yet?) on npm
image

@oysteinmoseng
Copy link
Member

@oysteinmoseng oysteinmoseng commented Jan 10, 2017

@crh225 5.0.7 is not released yet, however you can find the latest code here on github. Example: http://github.highcharts.com/highcharts.js

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

Successfully merging a pull request may close this issue.

None yet
3 participants