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

Setting up colors dynamically of a pie chart based on the color code values from the database

3 Answers 445 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Gurpreet
Top achievements
Rank 1
Gurpreet asked on 17 Sep 2019, 02:55 PM

We have a requirement to set up the colors of a pie chart dynamically based on the color code retrieved from the database. How can we achieve this with standalone report Designer ?

 

3 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 20 Sep 2019, 07:54 AM

Hi Gurpreet,

The slice color of a Pie chart may be set conditionally by using the DataPointConditionalFormatting property of the Graph series. In the Filters of the formatting rule specify the name of the series and in the Style set the required color. Please check the following screenshot - https://www.screencast.com/t/h9zPkUcEU.

More detailed information on how to use conditional formatting can be found in Conditional Formatting help article.

Best Regards,
Silviya
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Gurpreet
Top achievements
Rank 1
answered on 05 Dec 2019, 04:21 PM

Hi, 

I basically want to set the  background color field dynamically based on the value from the database.
FormattingRule.Style.BackgroundColor = Fields.Color (color field from the database) for every slice ? is it possible in standalone report  designer?

Thanks

 

 

0
Todor
Telerik team
answered on 10 Dec 2019, 09:50 AM

Hi Gurpreet,

The styles (e.g. background color) in the FormattingRule can be set only to the values that are available for selection. They cannot be set with an Expression. For that reason, you may use the Filter of the rule to check whether the 'Fields.Color' corresponds to a particular hardcoded color, and use this color as a background.

Regards,
Todor
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Gurpreet
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Gurpreet
Top achievements
Rank 1
Todor
Telerik team
Share this question
or