Line graph datum colouring


« 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 Mark on 1st August 2013
Hi


I should like to control the colour of each individual datum on a line graph, in a similar way one would on a bar graph using colors.sequential

Looking through the examples and docs I can't see how I might achieve this. Essentially the graph should be green for lower values, gradually phasing in to yellow and then red as the values increase.

I would be happy to do this using a dozen or so filled range thresholds though as far as I can tell I can only have one of these.

Is there something I'm missing or is this not supported?


Thanks
Mark
Posted by RGraph support on 1st August 2013
Hi there,


It sounds like you may be referring to something like this:

www.rgraph.net/demos/line-dual-color.html

This chart is one color below a certain point and another above - but it's only two colors (red/green).




Richard, RGraph Support

Help support RGraph - single site license only £99!
   www.rgraph.net/license#single-site
Posted by Mark on 1st August 2013
Hi Richard, thanks for the quick response

That is the effect that I'm trying to produce but with many colour bands, is that possible? Additionally the data may not be in ascending/descending order so many peaks and troughs.

If there isn't anything I may try and use globalCompositeOperation to apply a coloured gradient to the line


Thanks
Mark
Posted by RGraph support on 1st August 2013
Hi there,


Yes it would be possible - and this chart has peaks and troughs (you may need to hit refresh a few times):

www.rgraph.net/demos/line-dual-color-range.html

If you wish I can adjust the demo for you so that any number of thresholds are possible - just become a license holder and I'll adjust the demo for you.



Richard, RGraph Support

Help support RGraph - single site license only £99!
   www.rgraph.net/license#single-site

Add a reply

 




« Back to message list
RGraph on social media