Page 1 of 1

ColorRange Function

Posted: Fri Jan 08, 2010 9:44 am
by 15653079
Dear sirs,

i have a problem with TeeChart for .NET.
With an older version of the library (7.07 for Delphi) there was a function named "ColorRange" that allowed the user to change the color of a range of points for a graphic series.
Now, with my version of teechart for .NET, i cannot find the ColorRange function; there's some equivalent method?

In other words, How can I change the color for a range of points value in my graphic (...without rebuild the graph adding every point with his own color)?

Thanks in advance.

Re: ColorRange Function

Posted: Fri Jan 08, 2010 2:47 pm
by narcis
Hi e-ssentia,

This was in 3D series like: Surface, ColorGrid, Contour, etc.; for example:

http://www.teechart.net/support/viewtop ... nge#p13876

Wasn't it? Same properties and behaviour applies to TeeChart for .NET.

Hope this helps!

Re: ColorRange Function

Posted: Sat Jan 09, 2010 1:49 pm
by 15653079
Thanks NarcĂ­s for the reply.

The problem is that I don't use a 3D series. In my chart I use a line serie, and in my old Delphi application I used the following function:

Code: Select all

tChart1.Series[0].ColorRange(ValueList, FromValue, ToValue, Color);
So I need to know how can obtain the same result with the version for .NET (if it's possible).

Thanks in advance.

Re: ColorRange Function

Posted: Mon Jan 11, 2010 10:00 am
by yeray
Hi e-ssentia,

I've added this to the wish list to be implemented in future releases (TF02014632). In the meanwhile you could create your own function that would probably be very similar to the function that will be added to the sources as soon as possible:

Code: Select all

        private void ColorRange(Steema.TeeChart.Styles.Series ASeries, Steema.TeeChart.Styles.ValueList AValueList, double FromValue, double ToValue, Color AColor)
        {
            double tmpValue;
            for (int t = 0; t < AValueList.Count; t++)
            {
                tmpValue = AValueList.Value[t];
                if ((tmpValue >= FromValue) && (tmpValue <= ToValue) && (!ASeries.IsNull(t)))
                    ASeries.Colors[t] = AColor;
            }
            tChart1.Refresh();
        }

Re: ColorRange Function

Posted: Mon Jan 11, 2010 2:35 pm
by 15653079
Thanks Yeray, your function works!!! :wink: