I have looked through the documentation and the only reference I can find is for different colour series. However I have only one data series and would like points/bars on that series different colours.
I could use multiple series and make points set to zero, which would have the same effect.
Is there a supported mechanism for having different colour bars in a bar graph using flot ?
There isn't built in support for using multiple colors in a single series.
Flot only allows specifying colors of the dots at the dataseries level, meaning each color must be its own dataseries. With this in mind, the solution is to make a single dataseries for each color.
There is a Flot plugin that allows you to set the color based on threshold values that you set. You can get the plugin code here: https://github.com/subhrajitroy/Flot-plugin/blob/master/jquery.flot.threshold.multiple.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With