How do I show different colors on the Bar chart based on the value?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Tudorel Stirbu on 14th January 2016
I'm using RGraph and I think it is very good solution to draw charts for web.
I have a question about doing conditional bar chart and show different colors if data value in some range?
Example if value < 140 then red
if value < 180 and value >= 140 then yellow
if value >= 180 ten green, and so on ...
Thank you!
Posted by Richard on 14th January 2016
Hi,

You could build the colors, based on the data, before-hand and then set them on the chart object. Like this:


www.rgraph.net/fiddle/view.html/a-bar-chart-with-the-colorssequential-option



Richard
Posted by Tudorel Stirbu on 15th January 2016
Thank you very much it works well.
I'll sure give my feedback to many people on facebook, twiter and other connections.
Thank you again and RGraph is one of the best library for graphs and data visualization.

Best Regards!

Add a reply




« Back to message list