Adding values to a Line Series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Nellie
Newbie
Newbie
Posts: 12
Joined: Thu Jan 18, 2007 12:00 am

Adding values to a Line Series

Post by Nellie » Fri Jun 15, 2007 3:06 am

I need to manually add 10 values to a Line Series, X values are a date format and Y values are int, kind of ("06/10/07", 100).
Is there a quick way to do it?
Do I need to change the DataSource for this Series?

Also I was trying to use FillSampleValues() method requesting 10 samples but instead I was getting a random number of samples.
Here is the code I used:
tChart.Series.Add(lineSeries);
tChart.Series[0].FillSampleValues(10);

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jun 15, 2007 8:00 am

Hi Nellie,
I need to manually add 10 values to a Line Series, X values are a date format and Y values are int, kind of ("06/10/07", 100).
Is there a quick way to do it?
Do I need to change the DataSource for this Series?
No need to change series DataSource, you just need to do as in the examples Edu posted here. It may also be very helpful for you reading Tutorial 4 - Axis Control and Tutorial 6 - Working with Series. You'll find the tutorials at TeeChart's program group.
Also I was trying to use FillSampleValues() method requesting 10 samples but instead I was getting a random number of samples.
Here is the code I used:
tChart.Series.Add(lineSeries);
tChart.Series[0].FillSampleValues(10);


Yes, that's what FillSampleValues method does as you can see in TeeChart's help:
Adds random values to help visualize the Series. Each series class determines how many random points to add.

public Void FillSampleValues()
Adds the specified NumValues random points.

public Void FillSampleValues(System.Int32)
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Nellie
Newbie
Newbie
Posts: 12
Joined: Thu Jan 18, 2007 12:00 am

Adding values to a Line Series

Post by Nellie » Fri Jun 15, 2007 6:24 pm

Hi Narcís,

Thanks for your help.

Post Reply