Problem in Overriding Chart Skin

Thread is closed for posting
2 posts, 0 answers
  1. John
    John avatar
    41 posts
    Member since:
    Nov 2007

    Posted 05 Feb 2008 Link to this post

    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.

  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 06 Feb 2008 Link to this post

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