CodeYellowBV/chartist-plugin-legend

chart and legend colors don't match after clicking on label

MauroJurada opened this issue · 1 comments

Sorry if this is stupid, I'm new to this.

My issue is that after clicking on a label in legend to hide that entry from the chart the graph colors all update while the colors on legend don't.
image
after click:
image

I've also found that on https://codepen.io/chimmer/pen/aJvBgv same happens.

This is the css I use:
https://pastebin.com/xSF9EJCb
it's pure css, but that shouldn't matter since codepen has the same issue while using less, right?

I would want the chart to not update colors. Do I have to use onClick and manualy update the colors in my css?

That is pretty much just a CSS issue, you can't use the n-th child selector like I did in my pen you linked, but use selectors for the actual series' class names e.g. .ct-series-b. I simply copied your CSS and added line styles, you should be able to figure what's happening by that i hope: https://codepen.io/chimmer/pen/QVvMgz.