Displaying small values with a large Y axis range

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 larrybud on 13th February 2017
I'm trying to display a line graph that has a large Y axis range, but only 1 value which is large. Therefore the small values are essentially flat.

An example of a dataset would be:

[15487734,27280,32624,20378,13252,5044,3522,2244,1495,1441,856,3823,1680,388,1663,152,67,62,35,13,145,57,55],

As you can see, the first value is quite large as compared to the other values, so the other values are not obvious on the graph, however the values are important.

What's a good solution for something like this? Can I do something like Sql Reporting Services, where they add a "scale break" to the chart, as documented here:

msdn.microsoft.com/en-us/library/dd220529.aspx
Posted by Richard on 14th February 2017
Hi there,

There's no "scale break" mechanism, but you can have a logarithmic scale like this:

www.rgraph.net/canvas/docs/misc.html#log-scale

That's a canvas based example but it should be doable with the SVG libraries too with some nudging.


Richard
Posted by Mandar on 8th March 2017
Hi Richard,

Is it possible to have start the log scale starting from 0.01 instead of o.1? Also is it possible to different base values starting with 0.2 or 0.3.

Thanks

Posted by Richard on 8th March 2017
Hi there,

Well, I'm not sure I understand logs too well, but here's an example chart:

www.rgraph.net/fiddle/view.html/log-scale

You can have different bases - thats just the second argument to the log function. But I don't know about decimal base values.





Richard

Add a reply




« Back to message list