vasturiano / timelines-chart

Timelines Chart
http://vasturiano.github.io/timelines-chart/example/categorical/
MIT License
556 stars 121 forks source link

Color based on category #52

Closed richpaul1 closed 5 years ago

richpaul1 commented 5 years ago

Hi,

Can someone provide an example of setting the color of the segment based on the category, please?

e.g. if I want category A to be green and B to always be red.

richpaul1 commented 5 years ago

Figured it out

this.timeLineChart.zColorScale(d3.scaleOrdinal().domain(["A","B","C","D","E"]).range(['green', 'yellow', 'orange','red','purple']));