Page 1 of 1

Force same color to more series

Posted: Tue Apr 04, 2006 6:21 am
by 9529813
Hello,
I am using TeeChart Pro V7 with VB 6.0.
I need to display some series, and I need to assign one custom color to each pair of series (for example series(0) and series(1) red, series 2 and 3 blue and so on...).
How can I do?
I have seen that color assignement to series is automatic, and I cannot assign the same color to two or more series. I don't know how override this automatic color assignement.
Thank You
Begos

Posted: Tue Apr 04, 2006 8:27 am
by narcis
Hi Begos,

You an easily assign series color doing something like this:

Code: Select all

Private Sub Form_Load()
    For i = 0 To TChart1.SeriesCount - 1
        TChart1.Series(i).FillSampleValues 10
        If (i < 2) Then
            TChart1.Series(i).Color = vbRed
        Else
            If (i < 4) Then
                TChart1.Series(i).Color = vbBlue
            Else
                TChart1.Series(i).Color = vbGreen
            End If
        End If
    Next
End Sub