Line data for partial year extended across Y axis

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 Bernie Lindsey on 30th April 2014
I am trying to make a simple line chart that is compatible with IE8. The x-axis is year 2008 to 2020. I have a baseline data set for the full period (one line), another data set that shows a 2% reduction across the period 2008-2020 (second line), and and a data set for actual measure data for the period 2008 to 2013 (third line). For the third line, I am using two single quotes and an apostrophe for the numbers that don't exist yet (period from 2014 to 2020. Like this:

  var line = new RGraph.Line('cvs', [57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99], [57.99,56.83,55.67,54.51,53.35,52.19,51.03,49.87,48.62,47.56,46.40,45.24 ,44.08,42.92], [57.99,49.89,42.87,36.93,39.98,39.87,41.21,40.87,'','','','','',''])

  .set('labels', ['2008','2009','2010','2011','2012','2013','2014','2015','2016','2017','2018','2019','2020'])

The third line renders correctly in modern browsers (ends at 2013; however, in IE8, the line extends beyond 2013 in a different color, and not based on any data above. It displays nearly straight up, and then across for five years (above the baseline of 57.99) For the third data set above, is this incorrect way to account for the null data for the last six years?

Posted by Richard on 30th April 2014
Hi there,


Instead of using a string to represent "no data" try using null. For example:


www.rgraph.net/demos/line-null-values.html



  var line = new RGraph.Line('cvs', [57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99,57.99], [57.99,56.83,55.67,54.51,53.35,52.19,51.03,49.87,48.62,47.56,46.40,45.24 ,44.08,42.92], [57.99,49.89,42.87,36.93,39.98,39.87,41.21,40.87,null,null,null,null,null,null])




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

RGraph Priority Support: www.rgraph.net/support#priority-support
Posted by Bernie Lindsey on 17th May 2014
Thanks for the feedback. I should have provided all of the Javascript code that I was using. I had not set any shadows, and after adding:

  .set('shadow', false), the problem was solved.

In IE8, shadows were added for all lines (without .set('shadow', false)), even for the null values all the way out across all labels.
Posted by Richard on 18th May 2014
Ok the IE8 shadow should be fixed for the next release


Richard

Add a reply




« Back to message list