ComponentOne Chart for WPF and Silverlight
Chart for WPF and Silverlight / Chart Features / Style and Appearance / Chart Styles / Mouse Over Style
In This Topic
    Mouse Over Style
    In This Topic

    The following example shows how to create a style that sets the Stroke property for a PlotElement to Black:

    Copy Code
       <Style x:Key="mouseOver" TargetType="{x:Type c1c:PlotElement}">
              <!-- Default black outline -->         
              <Setter Property="Stroke" Value="Black" />
              <!-- When mouse is over the element make thick red outline  -->
                     <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Stroke" Value="Red" />
                            <Setter Property="StrokeThickness" Value="3" />
                            <Setter Property="Canvas.ZIndex" Value="1" />”
    Note: When you set the TargetType of your style to the PlotElement type without assigning the style with an x:Key, the style gets applied to both of your PlotElement elements.

    To apply the mouseover styles to the data series you can use set the SymbolStyle property like the following:

    Copy Code
    <c1c:DataSeries … SymbolStyle="{StaticResource mouseOver}"/>


    See Also