Page 1 of 1

iterate through a chart's series

Posted: Fri Jul 18, 2008 10:14 pm
by 13046874
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

Posted: Mon Jul 21, 2008 8:05 am
by narcis
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