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

Applying CSS styles to the bars dynamically

3 Answers 131 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sub
Top achievements
Rank 1
Sub asked on 29 Apr 2008, 05:07 PM
Hi,

I am not using any skin for the chart control. I want to assign the colors of the chart bars dynamically based on some condition. I am doing it as follows in the code behind. But I want to read these color codes from the CSS class instead of harcoding it. But I dont see any property that can be used to assing the CSSClass for the bars. How can I do it?


e.SeriesItem.Appearance.FillStyle.MainColor = System.Drawing.

ColorTranslator.FromHtml("#4e6a99");

3 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 30 Apr 2008, 05:59 AM
Hello Sub,

Generally RadChart produces a image and does not output HTML markup as other controls do thus you cannot style its elements via CssClass attributes. You will need to stick to the manual customization of the FillStyle as you have already started.


Best wishes,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sub
Top achievements
Rank 1
answered on 01 May 2008, 02:50 PM
Thanks for the reply. I am wondering why do you still have the properties such as Skin, SkinsOverridesStyle etc exposed in the Chart control if we can not apply any skins or css styles?
0
Giuseppe
Telerik team
answered on 01 May 2008, 06:53 PM
Hi Sub,

RadChart exposes such properties as it allows appearance customizations as well -- they are not based on CssClasses but on setting various properties across the control elements (you can then serialize and deserialize these modifications in xml skins for future use).

You can find more information on chart styling in the online help here (topics in Controls >> RadChart >> Styling RadCharts folder).


Sincerely yours,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (Obsolete)
Asked by
Sub
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Sub
Top achievements
Rank 1
Share this question
or