problem adding points to series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mel
Newbie
Newbie
Posts: 7
Joined: Mon Feb 05, 2018 12:00 am

problem adding points to series

Post by Mel » 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.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: problem adding points to series

Post by Christopher » Mon Feb 19, 2018 8:51 am

Hello Mel,

Don't worry about your English - if you prefer to communicate in Spanish please feel free to do so, we all speak Spanish here :)

I'm not entirely sure what your problem is, and so I think it would be helpful if you could create a simple MCVE (a Minimal, Complete, Verifiable Example as explained here). Once I have a MCVE I can modify the code for you so it works as you would like it to work.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply