The TeeChart component has a chart series called IFastLineSeries
.
It allows drawing simple "line type" charts.
Its interface provides a method called AddRealTime
which is a faster way to add data to the chart than the more generic AddXY
method.
But AddRealTime
has a few undocumented side effects:
The first feature is reasonable behavior in a lot of cases: for instance you want to keep showing the most recent process measurements as they are coming in.
However, in my case the automatic scaling for the bottom (X-axis) has been turned off. IMO it shouldn't touch the scaling settings then! But it does.
The second feature is worse: after auto scrolling, the control ensures that all the information is in view. This can slow down the application, because you may have accumulated lots of data in the fast line series which all has to be rendered then... Defeats the "is faster" philosophy behind the method...
I'm okay with the scrolling, but not with the automatic 'zoom out X' action.
Has anyone managed to get AddRealTime
working without that, or is there no other choice than to fall back to the slower AddXY
function?
I know I have to adjust the bottom axis myself then to achieve a similar scrolling effect, but at least it would not zoom out unexpectedly.
Remarks:
TA05011024
.You can control the behaviour you describe in the following way:
You could use Series.AddXY to avoid any of the AddRealtime's automatic behaviour; but you can anyway too, continue to use AddRealtime and modify the behaviour using your own SetMinMax of the Axis to scroll data off to the left, that way maintaining the same number of display points in the chart.
The demo here does just that and addresses your question. Github VB TeeChart Add Realtime demo project