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

RadHtml Chart

2 Answers 79 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 2
Kyle asked on 07 Aug 2013, 11:20 AM
Hi. I am using RadHTML charts to display some data which is being populated from a stored procedure using the SqlDataSource.
Here i have my x-axis being populated from a column which is in minutes.  All is fine, though i want to change the color of the bars that are shown above the 30min mark and again above the 45min mark.  How can i achieve this please?

I understand that i first must retrieve the data (i can do that with the code behind separately), though i cannot seem to manage to figure out how the bar color can be changed.

Thanks.
Kyle

2 Answers, 1 is accepted

Sort by
0
Accepted
Danail Vasilev
Telerik team
answered on 08 Aug 2013, 03:53 PM
Hello Kyle,

For a databound chart you can use the ColorField property of the series in order to reference a field from the datasource that contains the colors. Therefore you can create such a 'color column' in your datasource that contains colors based on particular condition.

Such an example is illustrated in HtmlChart - Conditional Item Colorization online demo.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Kyle
Top achievements
Rank 2
answered on 09 Aug 2013, 10:19 AM
Thank you very much. Followed the example you linked me too... Matched it and amended my code and its working perfectly :) thanks a lot!!
Tags
Chart (Obsolete)
Asked by
Kyle
Top achievements
Rank 2
Answers by
Danail Vasilev
Telerik team
Kyle
Top achievements
Rank 2
Share this question
or