Page 1 of 1

Real time charting - changing axis maximum

Posted: Thu Oct 01, 2009 4:03 pm
by 10045810
I am charting data in real time - scrolling as per your example of charting data in real time.

My data can range from 0-100%. I would like the axis->maximum not to be less than 10%, otherwise, I would like it to scale automatically. I am adding data to the chart 5 times per second. I can set the axis->Automatic feature on before I add data, add the data, and then check the axis->Maximum value and see if it is below 10%. At that point I can then set it the Maximum to 10%. Is this correct - will this work? If I do this, will the chart be bouncing between the automatic settting and the 10% - which would then be hard to follow?

What would you suggest as the best way to implement this?

Thank you for your assistance.
M Weingarden

Re: Real time charting - changing axis maximum

Posted: Fri Oct 02, 2009 10:49 am
by yeray
Hi M Weingarden,
MTW wrote:I can set the axis->Automatic feature on before I add data, add the data, and then check the axis->Maximum value and see if it is below 10%. At that point I can then set it the Maximum to 10%. Is this correct - will this work? If I do this, will the chart be bouncing between the automatic settting and the 10% - which would then be hard to follow?
I think that both answers are 'yes'. To do it this way, you'll need to repaint the chart to obtain the new left axis minimum and maximum calculated automatically, and then you'll need to check them and repaint the chart again if you decided to change the axis scale. So it would probably flicker if you do this 5 times per second.
MTW wrote:What would you suggest as the best way to implement this?
I think it would be more efficient if you check Series1.YValues.MaxValue each time you add a value to your series and actuate then in consequence without needing to repaint the chart to know it.