V5 Templates

TeeChart for ActiveX, COM and ASP
Post Reply
Bo Andersen
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Location: Copenhagen
Contact:

V5 Templates

Post by Bo Andersen » Wed Nov 17, 2004 10:23 am

I have a question on templates. If I create a template for a pie chart with
individual slices colored the way i want them, it seems that only the first
20 colors are saved with the template - meaning that when I load the
template back and add 25 data Items, only 20 (0-19) are colored the way i
specified. When loading the template into the commander and editing it, I
can also only see the 20 colors defined. I think the same goes for other
charts/series. Is there a limit of 20 in the template design? If so, has it
been increased in newer versions?

Best regards,

Bo

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 17, 2004 10:37 am

Hi Bo,

using the predefined colors (clTeeColor) gives you a selection of 20 different colours. If you need more colours than this then you will have to create your own colour palette with an extended number of colours. This could be done in it's most simplest form by creating an array e.g. myTeeColor(i).

Bo Andersen
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Location: Copenhagen
Contact:

V5 Templates

Post by Bo Andersen » Wed Nov 17, 2004 10:41 am

Hi Pep,

Thanks for a fast reply. I dont quite understand how it applies to my problem. I want to save the binary template with more than 20 colors defined. It seems it only retains the first 20. Is this a limit that can't be broken in the V5 template, and if so - is the limit of 20 also in v6 and v7.

Best regards
Bo
Pep wrote:Hi Bo,

using the predefined colors (clTeeColor) gives you a selection of 20 different colours. If you need more colours than this then you will have to create your own colour palette with an extended number of colours. This could be done in it's most simplest form by creating an array e.g. myTeeColor(i).

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 17, 2004 11:28 am

Hi Bo,
Thanks for a fast reply. I dont quite understand how it applies to my problem. I want to save the binary template with more than 20 colors defined. It seems it only retains the first 20. Is this a limit that can't be broken in the V5 template, and if so - is the limit of 20 also in v6 and v7.
Yes, the same limit applies for all three versions. But this can be solved defining an array of colors and using it. I've been able to do this using the following code (run, export to a tee file and then load it, it retains all the colors) :

Code: Select all

Private Sub Form_Load()
Dim myTeeColor(23) As OLE_COLOR
    TChart1.AddSeries scPie
For i = 0 To 22
    myTeeColor(i) = RGB(6 + (i * 7), 100 + (i * 5), 77 + i * 5)
Next i

For i = 0 To 22
    TChart1.Series(0).Add 3, "", myTeeColor(i)
Next i
    TeeCommander1.Chart = TChart1
End Sub

Post Reply