AdvancedHMI Software
General Category => Support Questions => Topic started by: paulm on February 20, 2017, 09:48:14 AM
-
I am successfully displaying data in the chartbysampling object however after a while the chart stops updating and the Time on the X axis stops. Is there any way the chart can keep updating with the latest data values.
Thanks
Paul
-
Does the chart stop recording or does it start discarding the oldest points? There is a property named MaximumActivePoints that limits the amount of data points on the chart. When it reaches that number of points, it discards the oldest. If your point values are not changing, it may appear the chart is no longer sampling.
-
Hi Archie,
Thanks for your reply
The chart seems to stop recording as the lines on the chart eventually disappear and the time on the X axis stops. see attachment
I know the value is good and comms are OK as i am displaying this on a meter as well
It seems as though the Chart stops displaying new values when it has reached maximum data points.
Regards
Paul
-
Hi Archie
I have set the series XvalueType to Auto and this works however I need to display time on the X axis so it needs to work with Time selected
Regards
Paul
-
Hi Archie
Did you find any issue with the X axis not continue when set to time but OK in Auto
Regards
Paul
-
- In Solution Explorer, expand down the AdvancedHMIControls project
- Expand down the Controls folder
- Right click ChartBySampling.vb and select View Code
- Go to line 314 and modify the code like this:
If MyBase.Series(index).Points.Count > m_MaximumActivePoints Then
MyBase.Series(index).Points.RemoveAt(0)
'* When X-Axis set to Date or Time, it does not auto scale, so force it
If MyBase.Series(index).XValueType = DataVisualization.Charting.ChartValueType.Time Or
MyBase.Series(index).XValueType = DataVisualization.Charting.ChartValueType.Date Or
MyBase.Series(index).XValueType = DataVisualization.Charting.ChartValueType.DateTime Then
MyBase.ChartAreas(0).Axes(0).Maximum = MyBase.Series(index).Points(MyBase.Series(index).Points.Count - 1).XValue
MyBase.ChartAreas(0).Axes(0).Minimum = MyBase.Series(index).Points(0).XValue
End If
' MyBase.Series(index).Points.Remove(x)
End If
-
Thanks Archie - Looks like its working now