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

HTML5 Reporting Bar Graph Dynamic Colour

1 Answer 140 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 02 Jun 2014, 08:10 AM
I am using VS2013 to design my report which I am then using in a MVC4 app with the HTML5 Report Viewer.
I have an objectDataSource which returns a list of object which have a total, name and a colour.
I can get the graph up but I don't see how to make each bar on the graph become the colour I have set in the object.
Also the series seem to be out of order

Is there a way to do this?

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 03 Jun 2014, 03:58 PM
Hello Matt,

If you want to change the color of multiple series, you will have to define a custom color palette.
The Graph item comes with built-in palettes, and you can define additional custom palette. These palette colors also appear in the legend. When multiple series are added to the chart, the chart assigns the series a color in the order that the colors have been defined in the palette.
For more information on changing the series colors, please check the Formatting Series Colors section of the Formatting Graph Series help article.

The approach to change the color of a single series based on the value or based on another field is to use Conditional Formatting. Conditional formatting lets you dynamically style report items based on rules that you define in the Conditional Formatting Rules Dialog. The property which allows you to set conditional formatting for the Graph series is DataPointConditionalFormatting.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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