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

Pie Chart Colours

1 Answer 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 15 Nov 2012, 10:58 AM
I have created a pie chart that binds to a SqlDataSource object.
I have created (in design time) a single series that binds the DataYColumn property to a Units column in the datasource and the DataLabelsColumn to a Status.
So far so good.
The problem I am having is that I would like to be able to change the colour of the pie slices. For example, The Completed slice should be Green, The In Progress slice should be Orange and the Errors slice should be Red.
I can't seem to figure out how to set these either at design time or programatically?
One thing to note is that I can't bind the datasource at runtime via the needdatasource due to restrictions in the application.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 16 Nov 2012, 04:54 PM
Hello Mike,

If you have bound the chart declaratively i.e. set the DataSource property to an SqlDataSource component, this means that the chart would automatically generate series and series items and you have no control over them. You would need to build the chart entirely programmatically and this way you would have full control over its styling. For more info, check How-To: Programmatically Data Binding Chart to a Generic List of Objects help article.

Regards,
Steve
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Tags
General Discussions
Asked by
Mike
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or