'Fills hystoric data in the linechart, using the FillerValue parameter, to avoid crashes
Public Sub FillPointGaps(FillerValue As Double)
If LineChart.IsInitialized=False Then Return
If LineChart.Points.IsInitialized=False Or LineChart.Points.Size<1 Then Return
For i=0 To LineChart.Points.Size-1
Dim ModdedPoint As PointDataL = LineChart.Points.Get(i)
If ModdedPoint.YArray.Length < TrackedParameters.Size Then
'mismatched size, must update Yarray
Dim newYarray(TrackedParameters.Size) As Double
'copy the other values
bc.ArrayCopy(ModdedPoint.YArray,0,newYarray,0,ModdedPoint.YArray.Length)
'fill the missing values with the filler parameter
For j=ModdedPoint.YArray.Length To newYarray.Length-1
newYarray(j)=FillerValue
Next
'...and reassign Yarray
ModdedPoint.YArray=newYarray
End If
Next
End Sub