This is a migrated thread and some comments may be shown as answers.
achieving fixed bar colors
1 Answer 18 Views
This is a migrated thread and some comments may be shown as answers.
Ken Lewis
Top achievements
Rank 1
Ken Lewis asked on 18 Jun 2013, 05:42 PM
I'm using the Graph object in Q1 2013 (instead of the obsolete Chart).

I have a stacked bar chart with three values (slight, moderate, severe) and I'm using a custom color palette to control the colors. The colors match up like so:
  • Slight = Green
  • Moderate = Yellow
  • Severe = Red

However, if I exclude a value, say Slight, I get the following:
  • Moderate = Green
  • Severe = Yellow

But what I want is:
  • Moderate = Yellow
  • Severe = Red

How can I achieve that?

Ideas:
  1. I realize I can use DataPointConditionalFormatting to color the bars, BUT that doesn't change the legend markers. Can I change the legend colors programmatically?
  2. Can I modify the Color Palette programmatically? If so, could I remove a color in the collection to control the default bar and legend colors?

Thanks for any help!

Ken

UPDATE:

To get around the non-matching legend colors issue I did the following:
  1. Used conditional formatting to color the bars.
  2. Hid the default legend.
  3. Added my own static legend on the report below the chart.

That's not a bad solution, but I would still like an answer to my questions above.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 21 Jun 2013, 04:04 PM
Hi Ken,

Thank you for your update. Currently your solution is what we can suggest you because the conditional formatting applies on specific bars, thus the legend should not reflect the change.

In addition, just to let you know we are researching possible solutions to the described scenario.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Asked by
Ken Lewis
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or