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

Problem in Overriding Chart Skin

1 Answer 125 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 05 Feb 2008, 10:27 AM
Hi,

We are using Telerik chart in our Project with DNN Framework.
We would like to use the skins provided by telerik in our chart and also to override the bar colors of the existing skin. But we are not able to overrite the default bar colors provided by the telerik in the skin.

Eg. Chart with skin color "Light Green". Bars  are having the same color.
we are setting the  bar color of the chart programatically like below using a fucntion and this function is called after databinding and setting the chart properties programatically

Private

Sub SetColourRange()

For Each item As Telerik.Charting.ChartSeriesItem In Me.RadChart1.Series.Item(0).Items

If item.YValue <= 40 Then

item.Appearance.FillStyle.MainColor = Drawing.Color.Red

item.Appearance.FillStyle.SecondColor = Drawing.Color.Pink

ElseIf item.YValue <= 60 Then

item.Appearance.FillStyle.MainColor = Drawing.Color.Yellow

item.Appearance.FillStyle.SecondColor = Drawing.Color.Silver

ElseIf item.YValue > 60 Then

item.Appearance.FillStyle.MainColor = Drawing.Color.Green

item.Appearance.FillStyle.SecondColor = Drawing.Color.GreenYellow

End If

Next

End Sub


But we are hopeless. Bar color remains unchanged. Is there a way to override the bar color of the chart after setting desired skin.

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 06 Feb 2008, 03:46 PM
Hello Bidan,

Please, make sure you use RadControls "Prometheus" 2007 Q3 SP1 (2007.3.1314). With this version you will not need to do anything special to achieve this. The steps you have described are correct.

In RadControls "Prometheus" 2007 Q3 (2007.3.1218) setting the skin to RadChart used to set its SeriesPalette  property that dictated the bar colors. To workaround this you can wire PrePaint event and set RadChart1.SeriesPalette = ""

Hope this helps.

Regards,
Ves
the Telerik team

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