This is a migrated thread and some comments may be shown as answers.
Setting bar colours
2 Answers 47 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
William Hurst
Top achievements
Rank 1
William Hurst asked on 08 Nov 2011, 12:39 PM
Is there a way to set a different colour for each bar in a bar chart?

2 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 08 Nov 2011, 06:54 PM
Hi,

I believe you can do this similar to my suggestion for custom labels on each bar.... (http://www.telerik.com/community/forums/aspnet-mvc/chart/gantt-chart-24h-timetable.aspx)

in addition to my changes in telerik.chart.js  - at addValue modify

            var bar = new Bar({
                color: myBarLabel,

and for the values add you color after the | ... 
eg. 
                new SalesData
                {
                    RepName = "Nancy Davolio", 
                    DateString = "Aug 2010",
                    TotalSales = 10458,
                    RepSales = "2015|#83cc00"
                },

kind regards,
mike
0
William Hurst
Top achievements
Rank 1
answered on 15 Nov 2011, 01:45 PM
Great, I've managed to hack a solution together from your suggestion :)
Tags
Chart
Asked by
William Hurst
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
William Hurst
Top achievements
Rank 1
Share this question
or