Line chart: Out of bounds

Share RGraph:   Share or Like RGraph on Facebook!

« 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 jlost55 on 16th April 2014
My chart have a y axis of 1200.

I have also this data:

[606,730,792,855,918.,981.,1045,1109,1174,1239,1305,1371,1438,1505,1573,1642,1712, ...]

When I checked "outofbounds" to true. It draws my lines more than 1200. You can show my lines outside the graphic.

When I checked "outofbounds" to false. It draws only the lines up to 1200. My line stop by 1174.

When I change the numbers higher than 1200 to 1200. It draws continue my line to right.

When I delete the numbers higher than 1200. It will reform my line chart.
---

How can I draw my line and stop with drawing by 1200?
Posted by Richard on 16th April 2014
Hi there,

I can't tell what you're asking - though when you use the outofbounds setting you should use a ymax setting too so that the maximum scale value is whatever you set as the ymax.

eg.

obj.set('ymax', 1200)
obj.set('outofbounds', true)




Richard
Posted by jlost55 on 17th April 2014
Yes I know, I will that my lines stops to draw on 1200 and not higher than 1200.
Posted by Richard on 17th April 2014
Hi there,

Well here's an example of a similarly configured chart with a ymax of 1200 and outofbounds set:

www.rgraph.net/fiddle/view/a-line-chart-with-a-maximum-value-set




Richard
Posted by jlost55 on 17th April 2014
Hi,

I would like to only see the lines below and equal 1200. It should stop drawing above 1200.

Lines are only visible in the graph, and not out of the graph.

[606,730,792,855,918.,981.,1045,1109,1174,1239,1305,1371,1438,1505,1573,1642,1712, ...]

When I change "Outofbounds" to "false", the line is drawn up in 1174 (see first post). The points greater than 1200 are not shown up but would like to have my line until 1200.

Sorry it's difficult to explain my problem in English. My English is not so good :(.
Posted by Richard on 17th April 2014
Hi there,

If you don't want the points above 1200 drawn then you need outofbounds set to false (this is actually the default setting) and the ymax set to 1200 like this:

obj.set('ymax', 1200)
obj.set('outofbounds', false)





Richard
Posted by jlost55 on 17th April 2014
Problem 1
----------
www.dropbox.com/s/6lqgpqjsdmb027v/probleem1.PNG

var line = new RGraph.Line(canvas, data)
  .set('background.grid', false)
         .set('ylabels', false)
         .set('tickmarks','null')
         .set('gutter.left', 55)
         .set('outofbounds', false)
         .set('ymax', 1200)
         .set('noaxes', true)");

Problem 2
---------
www.dropbox.com/s/ouqq8b7xpjij9vv/probleem2.PNG

var line = new RGraph.Line(canvas, data)
  .set('background.grid', false)
         .set('ylabels', false)
         .set('tickmarks','null')
         .set('gutter.left', 55)
         .set('outofbounds', true)
         .set('ymax', 1200)
         .set('noaxes', true)");

Problem 3
---------
www.dropbox.com/s/bhyndygxdl0iv0s/probleem3.PNG

var data = [..., 918.118450414539,981.498900542484,1045.29984488339,1109.54756432557,1174.26833975734,1200,1200,1200,1200,1200,1200,...];


Problem 4
---------
www.dropbox.com/s/8qlt1i9nqxcrw72/probleem4.PNG

var data = [..., 918.118450414539,981.498900542484,1045.29984488339,1109.54756432557,1174.26833975734,1200,,,,,,...];

The solution
------------
www.dropbox.com/s/faj2p1revwggkiw/idee.PNG

I've drawn and changed this image in Paint after creating a screenschot. This is I will it on my chart.

Is there a solution?
Posted by Richard on 17th April 2014
Hi there,

Still not sure what it is you're after - but maybe this:

www.rgraph.net/fiddle/view/a-line-chart-with-clipping




Richard
Posted by jlost55 on 18th April 2014
Yes, thank you! It works with clipping.

Add a reply




« Back to message list