Applying CSS styles to the bars dynamically

Thread is closed for posting
4 posts, 0 answers
  1. Sub
    Sub avatar
    91 posts
    Member since:
    Nov 2007

    Posted 29 Apr 2008 Link to this post

    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");

  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 30 Apr 2008 Link to this post

    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
  3. Sub
    Sub avatar
    91 posts
    Member since:
    Nov 2007

    Posted 01 May 2008 Link to this post

    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?
  4. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 01 May 2008 Link to this post

    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
Back to Top