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

Setting chart series font appearance

2 Answers 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
psanchez117
Top achievements
Rank 1
psanchez117 asked on 28 Sep 2011, 03:59 PM
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 Answers, 1 is accepted

Sort by
0
IvanDT
Telerik team
answered on 03 Oct 2011, 06:06 PM
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 >>
0
Jon
Top achievements
Rank 1
answered on 30 Aug 2012, 05:44 PM
thx!!!
Big help
Tags
General Discussions
Asked by
psanchez117
Top achievements
Rank 1
Answers by
IvanDT
Telerik team
Jon
Top achievements
Rank 1
Share this question
or