Series color

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Berntsen
Newbie
Newbie
Posts: 11
Joined: Wed Oct 05, 2005 4:00 am

Series color

Post by Berntsen » Wed Aug 02, 2006 2:44 pm

Hi All

I have a small problem. My application has a graph with multiple line
series. The number of series is unknown at design time. The users would like
to have the series color ramp between two colors (i.e. Green to Yellow or
Blue to Red). They would like to make the start and end colors user
selectable, but this is not essential.

Is there an easy way that I can implement a color ramp?

I'm using BDS 2006 (C++ personality) and TeeChart 7.06

Any help will be greatly appriciated! Jørgen

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

Post by Pep » Thu Aug 03, 2006 8:20 am

Hi Berntsen,
one way could be using a custom palette. You can see one example in the Demo Features project (included into the TeeChart Pro installation) under :
What0s New -> Themes -> Custom Palettes

Berntsen
Newbie
Newbie
Posts: 11
Joined: Wed Oct 05, 2005 4:00 am

Post by Berntsen » Thu Aug 03, 2006 8:28 am

Hi Pep

As far as I can see these examples only includes a gradient of i.e. red. My problem is to produce a gradient or ramp between two different colors.

How do I produce i.e. 15 RGB values that ranges from green to yellow??

Any suggestions?

Regards Jørgen

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

Post by Pep » Thu Aug 03, 2006 9:56 am

Hi Jørgen,

In that case, there's not a way to do it automatically, you will have to calculate the RGB color manually and then assign it to the Series using :
Series1.ValueColor[index]:=XColor;
or using the ColorRange method of the Series to assign same color for some range values.

Berntsen
Newbie
Newbie
Posts: 11
Joined: Wed Oct 05, 2005 4:00 am

Post by Berntsen » Thu Aug 03, 2006 10:27 am

Hi Pep

This is excatly my original problem. I don't know how to calculate the RBG value manually. I looked at the www but could not find any code to do this. This was why I posted this question.

Has anybody reference to some code that can calculate the RGB values between to colors??

Any help will be greatly appriciated, Thanks Jørgen

Post Reply