Setting chart series font appearance

3 posts, 0 answers
  1. psanchez117
    psanchez117 avatar
    3 posts
    Member since:
    Jul 2012

    Posted 28 Sep 2011 Link to this post

    Hi,

    I was unable to find this anywhere so I fooled around with it until I figured it out.
    I noticed that setting the series text appearance does not seem to work in the Q1-2011 version of reporting. You can set the style and colors all you want but something overrides the style at Runtime.

    I got around this by setting the style programmatically at run time in the chart_ItemDataBound event.

    Private Sub Chart1_ItemDataBound(sender As Object, e As System.EventArgs) Handles Chart1.ItemDataBound
     
        Chart1.Series.Item(0).Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.FromArgb(CType(CType(252, Byte), Integer), CType(CType(186, Byte), Integer), CType(CType(47, Byte), Integer))
        Chart1.Series.Item(0).Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 8.25!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle))
        Chart1.Series.Item(1).Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.FromArgb(CType(CType(252, Byte), Integer), CType(CType(186, Byte), Integer), CType(CType(47, Byte), Integer))
        Chart1.Series.Item(1).Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 8.25!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle))
    End Sub


    The result of which seems to be that it sets the style formatting AFTER any override occurs on the design formatting.

    I hope this is helpful to anyone out there having the same problem.

    -Phil
  2. IvanDT
    Admin
    IvanDT avatar
    76 posts

    Posted 03 Oct 2011 Link to this post

    Hello Phil,

    It is possible to set the chart series font appearance. You must take in consideration the following when you set custom properties:
    • Chart's Skin - This is with high priority for Chart style(Chart&Series font, Chart&Series borders and etc.);
    • Series Palette - This is second priority after Skin for Series Style(Series font, Series borders and etc.). If Chart's Skin is set it will overwrite Series Palette customizations;
    • Series(Collection) Appearance - This is with third priority after Series Palette. Here for every chart series you can set font, border and etc. If some of the above properties are applied they will overwrite Series Appearance.
    • Custom Palettes - This with forth priority after Series(Collection) Appearance. If some of the above properties are applied they will overwrite the Custom Palettes.

    Kind regards,
    IvanDT
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 30 Aug 2012 Link to this post

    thx!!!
    Big help
Back to Top