Force same color to more series

TeeChart for ActiveX, COM and ASP
Post Reply
Begos
Newbie
Newbie
Posts: 4
Joined: Mon Jan 09, 2006 12:00 am
Location: Bologna, Italy

Force same color to more series

Post by Begos » Tue Apr 04, 2006 6:21 am

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

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

Post by Narcís » Tue Apr 04, 2006 8:27 am

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
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