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