iterate through a chart's series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

iterate through a chart's series

Post by FP_Oz » Fri Jul 18, 2008 10:14 pm

Hi Narcis,

I'm trying to iterate through a chart's series and to do different things to different chart types.
Something slong the lines of:

For Idx As Integer = 0 To tchart.Series.Count - 1
Select Case tchart.Series(Idx).???
Case Styles.line
DO SOMETHING
Case Styles.points
DO SOMETHING ELSE
End Select
Next

I just can't find the right code to do this basic stuff. Can you please help me?

Cheers
Francis

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

Post by Narcís » Mon Jul 21, 2008 8:05 am

Hi Francis,

Yes, you can try something like this:

Code: Select all

        Dim i As Integer

        For i = 0 To TChart1.Series.Count - 1
            If (TypeOf TChart1(i) Is Steema.TeeChart.Styles.Line) Then
                CType(TChart1(i), Steema.TeeChart.Styles.Line).LinePen.Width = 5
            Else
                'Do something else
            End If
            i = (i + 1)
        Next
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

Post Reply