Combined line/bar: change line to behind the bars?


« 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 Rachel on 19th August 2013
I was just wondering if there was way to render the line chart *behind* the bar chart? I didn't see this in the documentation anywhere.
Posted by RGraph support on 19th August 2013
Hi there,

Not using the Combined class - but if you configure everything yourself then the charts are drawn on the canvas in the order that you call the Draw() methods - like this:

www.rgraph.net/fiddle/view/a-bar-chart-with-a-line-chart-at-the-back

Richard, RGraph Support

Help support RGraph - single site license only £99
   www.rgraph.net/license#single-site
Posted by Rachel on 19th August 2013
Ah thank you. I probably should have guessed that myself :)

One odd thing I notice now - without using the "combined" class, my "labels.above.specific" within my bar changed colors: they are being rendered the color of my bars, rather than the default black.
Setting 'text.color' didn't fix the issue...any ideas?
Posted by RGraph support on 19th August 2013
Hi there,

I can't seem to replicate that - but try beginning a new path and then closing it - as now shown - between drawing charts.

www.rgraph.net/fiddle/view/a-bar-chart-with-a-line-chart-at-the-back





Richard, RGraph Support

Help support RGraph - single site license only £99
   www.rgraph.net/license#single-site
Posted by Rachel on 19th August 2013
Hmm I've narrowed the problem down to this:
if I use ".Set('ylabels', false)" on the bar chart, then it changes the colors of the above labels. That is rather strange. After removing that line, then the labels are black like they are supposed to be.

Add a reply

 




« Back to message list
RGraph on social media