problem adding points to series
Posted: Thu Feb 15, 2018 8:21 pm
Hi,
I'm working with VS2017 and steema.teechart.net.standard.4.2018.2.12 version in VB.NET language.
I want to do a generic function to call from a timer (i have a mdi form and all of the child forms have teechart inside), so to the function i pass the name of the tchart and the number of series. I have this:
Public Sub inicia_grafico(ByVal grafico As Steema.TeeChart.TChart, ByVal num_series As Integer)
Dim j As Integer
With grafico
For j = 0 To num_series - 1 ' to create the series
If f = 0 Then ' the first time the timer triggers
.Series.Add(Line)
Line.Add(f, HEJE)
Else
.Series.Add(Line) ' If i do it like series(j).add(line) an error appears "interval out of range"
Line.Add(f, HEJE +j) 'trying To add points to the line In the serie (HEJE Is a Public variable that changes every 5 seconds)
End If
Next
End With
f = f + 1
End Sub
The problem is, its only adding 1 serie to the chart and the points are repeating according to (num_series-1) value. Is there a way to adding more than 1 serie to a chart at the same time and adding points to them? Am I clear? Please help me.
PS: Sorry my english is not so good.
I'm working with VS2017 and steema.teechart.net.standard.4.2018.2.12 version in VB.NET language.
I want to do a generic function to call from a timer (i have a mdi form and all of the child forms have teechart inside), so to the function i pass the name of the tchart and the number of series. I have this:
Public Sub inicia_grafico(ByVal grafico As Steema.TeeChart.TChart, ByVal num_series As Integer)
Dim j As Integer
With grafico
For j = 0 To num_series - 1 ' to create the series
If f = 0 Then ' the first time the timer triggers
.Series.Add(Line)
Line.Add(f, HEJE)
Else
.Series.Add(Line) ' If i do it like series(j).add(line) an error appears "interval out of range"
Line.Add(f, HEJE +j) 'trying To add points to the line In the serie (HEJE Is a Public variable that changes every 5 seconds)
End If
Next
End With
f = f + 1
End Sub
The problem is, its only adding 1 serie to the chart and the points are repeating according to (num_series-1) value. Is there a way to adding more than 1 serie to a chart at the same time and adding points to them? Am I clear? Please help me.
PS: Sorry my english is not so good.