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

4 posts, 0 answers
  1. Gurpreet
    Gurpreet avatar
    11 posts
    Member since:
    Nov 2018

    Posted 17 Sep Link to this post

    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 ?

     

  2. Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 20 Sep Link to this post

    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
  3. Gurpreet
    Gurpreet avatar
    11 posts
    Member since:
    Nov 2018

    Posted 05 Dec in reply to Silviya Link to this post

    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

     

     

  4. Todor
    Admin
    Todor avatar
    397 posts

    Posted 2 days ago Link to this post

    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
Back to Top