ColorRange Function

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
e-ssentia
Newbie
Newbie
Posts: 3
Joined: Thu Apr 30, 2009 12:00 am
Contact:

ColorRange Function

Post by e-ssentia » Fri Jan 08, 2010 9:44 am

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.

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

Re: ColorRange Function

Post by Narcís » Fri Jan 08, 2010 2:47 pm

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

e-ssentia
Newbie
Newbie
Posts: 3
Joined: Thu Apr 30, 2009 12:00 am
Contact:

Re: ColorRange Function

Post by e-ssentia » Sat Jan 09, 2010 1:49 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: ColorRange Function

Post by Yeray » Mon Jan 11, 2010 10:00 am

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();
        }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

e-ssentia
Newbie
Newbie
Posts: 3
Joined: Thu Apr 30, 2009 12:00 am
Contact:

Re: ColorRange Function

Post by e-ssentia » Mon Jan 11, 2010 2:35 pm

Thanks Yeray, your function works!!! :wink:

Post Reply