Stipulating the z-order of charts

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Jose on 27th April 2014
I have 4 series that given their relative importance I want to appear in this order:

1
2
3
4

However, the latter series are overwriting the former (using the line graph), so 2 overwrites 1, 3 overwrites 1 and 2, and 4 overwrites 1, 2, 3.

When they overlap, the visible colour is the one from the last series (which I wanted to appear at the bottom of the legend because they were less important).

So, is there a way of specifying the z-order for each series, or the order of the series in the legend?


Regards, Jose.
Posted by Richard on 28th April 2014
Hi there,

The only way would be to put the data series that you want "at the back" would be to specify it first. You can use the arrayReverse function to then reverse the order of the key array:

var key = ['Richard','Bob','Lucy','John';
     key = RGraph.arrayReverse(key);





Richard
www.rgraph.net
If RGraph has helped you - please share the website - thanks!

RGraph Priority Support: www.rgraph.net/support#priority-support

Add a reply




« Back to message list