hatemalimam / ChartistJSF

Highly Customizable Responsive Charts for JavaServer Faces.
https://chartistjsf-showcase.herokuapp.com
Apache License 2.0
39 stars 12 forks source link

Possible to define colors of a series? #14

Closed rosscoden closed 7 years ago

rosscoden commented 7 years ago

Hi,

thank you for the chart. Is it possible to change the color of a series?

hatemalimam commented 7 years ago

Sure, the series have an alphabetical order, for example to change the first series color, you may try this:

div.ct-chart .ct-series.ct-series-a .ct-bar, div.ct-chart .ct-series.ct-series-a .ct-line, div.ct-chart .ct-series.ct-series-a .ct-point,
    div.ct-chart .ct-series.ct-series-a .ct-slice.ct-donut {
    stroke: #9b0902;
}

div.ct-chart .ct-series.ct-series-a .ct-area, div.ct-chart .ct-series.ct-series-a .ct-slice-pie:not(.ct-donut) {
    fill: #9b0902;
}

notice the ct-series-a, the "a" is the first, so to change the rest as you go in order, "b","c" etc..