0

I have the need to programmatically change the background color of the plot area of a line chart in the Telerik RadChart control in a Silverlight 4 application. I also need to be able to change the size and visibility of the PointMarker on a line chart. I cannot figure out how to do either.

The closest I have gotten is changing the background color of the ChartArea, but that changed the background color of everything except the PlotArea.

All of the sample code I have found on the Telerik site that mentions PointMarker is for te ASP.NET RadChart. The programming model for that control seems very different.

Thanks, Jim

Jim Reineri
  • 2,830
  • 3
  • 31
  • 32

1 Answers1

1

You can change the background color of the Plot Area with this implicit Style:

  <telerik:RadChart x:Name="RadChart1">
        <telerik:ChartArea>
            <telerik:ChartArea.PlotAreaStyle>
                <Style TargetType="telerik:ClipPanel">
                    <Setter Property="Background" Value="Yellow"/>
                </Style>
            </telerik:ChartArea.PlotAreaStyle>
        </telerik:ChartArea>
    </telerik:RadChart>

Take a look at this help topic where it is demonstrated together with a source code how to change the Visibility of the PointMarks for particular points.

Evgenia
  • 268
  • 2
  • 9
  • Thanks. I had to adopt my solution from your answer, but these clues led me to a very good solution. I predefined several colors as styles and placed them in the Resources, then from the code I set the selected Style by key name. I will post the final code when I get it finalized. – Jim Reineri Aug 09 '11 at 14:00