Pie chart - custom colors

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Pie chart - custom colors

Post by UserLS » Wed Mar 09, 2011 4:53 am

I am playing with selecting a custom color for my pie slices. When I try to select black the result is really amazing! In some cases it selects random color, while sometimes it does keep my black, but then in the legend the "black" slice looses its symbol. Well, I did get curious and spend some time to figure out what in fact it was doing. What I found is that when I select black color, for pie chart it means "select an appropriate color for the selected slice from current color palette" - so here is the random color selection (not a single user will connect selection of black color with some type of default selection and most of them will not even know about the color palette). It gets better if my color palette includes black. In this case if I tell pie chart to do its magic selecting a color and it happens to be black - then no symbol is shown in the legend. I am not sure why you did go through this type of pain for a simple thing like just selecting a color, but please, if I as a user have selected a color (any color) do not play God and select something else for me, just keep my selection!

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Pie chart - custom colors

Post by Sandra » Thu Mar 10, 2011 11:24 am

Hello UserLS,

I couldn't reproduce your problem here. Can you please, explain exactly steps you followed? So we can reproduce exactly your problem here.

Thanks,
Best Regards,
Sandra Pazos / 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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Re: Pie chart - custom colors

Post by UserLS » Thu Mar 10, 2011 9:13 pm

Well, the change was made to Series.ValueColor method (I am not sure if it affects all series types or circular only). If I set:

Code: Select all

Series[n].Color = Color.FromRGB(0, 0, 0)
Series.ValueColor returns some other (default) color, not the one I've selected, which was not the case before. This value is not displayed on the legend, if Color.FromRGB(0, 0, 0) is included into my color palette either (and If I use Color.Black instead it will work just fine). My problem is: I have no control over what clients are setting on their graphs and Color.FromRGB() is used a lot in our code too. It is weird though, that my selection is not kept anymore and replaced with some other value.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Pie chart - custom colors

Post by Sandra » Fri Mar 11, 2011 11:16 am

Hello UserLs,

Thanks for your information. I have added your request in bug list report with number[TF02015443]. We will try to fix it to future maintenance releases of TeeChart.Net.
On the other hand, Could you tell us which is the version that next code works correctly for you?

Code: Select all

   Steema.TeeChart.Styles.Pie series1 = new Steema.TeeChart.Styles.Pie(tChart1.Chart);
            series1.FillSampleValues(4);
            for (int i = 0; i < series1.Count; i++)
            {
                series1[i].Color = Color.FromArgb(0, 0, 0, 0);

            }
Thanks,
Best Regards,
Sandra Pazos / 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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Re: Pie chart - custom colors

Post by UserLS » Fri Mar 11, 2011 7:02 pm

The version we upgraded from was the July (or may be April) build in 2010 and it was working correctly then.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Pie chart - custom colors

Post by Sandra » Mon Mar 14, 2011 9:01 am

Hello UserLs,

Thanks for your information, we have checked that in version 4.0.2010.27961 the property FromArgb works as expect.

Thanks,
Best Regards,
Sandra Pazos / 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

Post Reply