This is a migrated thread and some comments may be shown as answers.

Get Series Color

4 Answers 75 Views
Chart
This is a migrated thread and some comments may be shown as answers.
John Morris
Top achievements
Rank 1
John Morris asked on 14 Jan 2010, 03:56 PM
I have a Stacked Bar chart that, when clicked, will drill down to a doughnut chart.  The problem I'm having is getting the colors in the stacked bar over to the doughnut.  I can set the doughnut colors but cannot get the colors used in the original.  I'm using the default assigned colors for the Stacked Bar.

Is there a property to determine the assigned colors in a Stacked Bar or do I need to set each explicitly?

4 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 19 Jan 2010, 07:30 AM
Hello John,

There is the following issue with Silverlight: having reference to a Style does not help obtaining the values for say Foreground or Fill, or any other property, since the Property objects (set to Setter.Property) are translated to native resources and there is no way of obtaining any useful information out of those.

We are currently extending the styling mechanism of the RadChart to enable easy color customization, i.e. Styles will be built using data provided by the developer. That, however, will only allow you to provide custom colors, but not get them back since the fore-mentioned problem will still persist.

Regards,
Evtim
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Grtjn
Top achievements
Rank 1
answered on 25 Mar 2010, 01:31 PM
Hi John,

How whre you able to set the colours of your doughnut? Did you use a style for this ?
I have a doughnut and when i click on a slice, my barchart draws some bars. I want my bars in the barchart to have the same colors as the slice of the doughnut i clicked on. So if you could tell me how you were able to set these colours, maybe I can use this to assign that colour to the bars...

And if possible, can you add some code to explain?

Kind regards,

Gertjan
0
John Morris
Top achievements
Rank 1
answered on 25 Mar 2010, 03:40 PM
Hello Gertjan. I have not addressed this problem yet.  Since I cannot get colors from an existing chart, my plan is to have all possible series colors as as constants and assign each time.  I'm not looking forward to this but I don't see any other way.  
0
Grtjn
Top achievements
Rank 1
answered on 25 Mar 2010, 06:28 PM
Ok,

Thanks for your reply!

Gertjan
Tags
Chart
Asked by
John Morris
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Grtjn
Top achievements
Rank 1
John Morris
Top achievements
Rank 1
Share this question
or