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

Get the color being used for a layer #137

Closed
simonwistow opened this issue Sep 15, 2014 · 5 comments
Closed

Get the color being used for a layer #137

simonwistow opened this issue Sep 15, 2014 · 5 comments
Labels

Comments

@simonwistow
Copy link

When trying to make an external key for a chart it would be useful to be able to somehow get the color being used for a layer so that I can make the key the same color and have it change if I change theme.

@BradleyFord
Copy link

@simonwistow I agree

We are currently using a different library and are planning to move to epoch. We use an external key in this manner.

@rsandor
Copy link
Collaborator

rsandor commented Sep 17, 2014

So there are two possible colors that are being used for each of the charts: the fill and stroke colors. I assume you want whatever is available, and when both are you want the fill?

@rsandor
Copy link
Collaborator

rsandor commented Oct 4, 2015

The colors are dictated by the CSS. Specifically you can find the color of a particular category by using the div.ref.category1 through div.ref.category20 classes inside a div with the class .epoch.

@rsandor
Copy link
Collaborator

rsandor commented Oct 4, 2015

Going to add a documentation issue that specifically addresses communicating this.

@Marco-Sulla
Copy link

How can I change the color of a realtime graph? I've fond only this bad trick:

chart.getVisibleLayers()[0].className = "layer category2"
chart.redraw()

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

No branches or pull requests

4 participants