Page 1 of 1

Series color

Posted: Wed Aug 02, 2006 2:44 pm
by 9238722
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

Posted: Thu Aug 03, 2006 8:20 am
by Pep
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

Posted: Thu Aug 03, 2006 8:28 am
by 9238722
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

Posted: Thu Aug 03, 2006 9:56 am
by Pep
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.

Posted: Thu Aug 03, 2006 10:27 am
by 9238722
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