Adding new styles

This section gives information on styling the datapoints (whether selected or not)

Changing the styles for the datapoints (and the legends) is a matter of defining the style and refering to it in the XAML.
  • The line style uses a Target Type = Path
  • The scatter and column use Target Type = Rectangle. (Just use the Radius X and Radius Y to get circles)
  • The styles must be linked to your project like standard styles (see Documentation)
  • You can either base your style on the default GAStyles in the Graph.XAML or create new ones. If properties are not supplied (ie width, fill etc) they will not default to the default styles unless you base the style on the defaults.
  • If you want to have the colours taken from the pallette and changed for each series automatically, then leave the Fill or Stroke out. The default styles have no Fill or Stroke settings, so the colours are taken from the default pallette as defined in the original charts colour pallette documentation.
  • Transparent values are allowed.
  • The default styles are GALineStyle, GAColumnPieceStyle, GAScatterBulletStyle

Base Styles

  • The default Line Style - 1 px thick with colour taken from pallette.
<Style x:Key="GALineStyle" TargetType="Path" >
        <Setter Property="StrokeThickness" Value="1"></Setter>
  • The default Scatter Style - a 8px diameter circle, with no stroke, and the fill colour taken from pallette.
<Style x:Key="GAScatterBulletStyle" TargetType="Rectangle" >
        <Setter Property="Height" Value="8"></Setter>
        <Setter Property="Width" Value="8"></Setter>
        <Setter Property="RadiusX" Value="4"></Setter>
        <Setter Property="RadiusY" Value="4"></Setter>
        <Setter Property="StrokeThickness" Value="0"/>
  • The default Column Style - no stroke around the rectangle with fill colour taken from pallette.
<Style x:Key="GAColumnPieceStyle" TargetType="Rectangle" >
        <Setter Property="StrokeThickness" Value="0"/>

Additional examples

  • Transparent Scatter
It looks like there is no bullet but there is still a mouse over tool-tip. Could be used to 'fake' a line with tool tip on a point, and allow for point selection too.

    <Style x:Key="GATransparentScatterBulletStyle" TargetType="Rectangle" BasedOn="{StaticResource GAScatterBulletStyle}" >
        <Setter Property="Fill" Value="Transparent"></Setter>
        <Setter Property="Stroke" Value="Transparent"/>
  • Square with black line with red fill
    <Style x:Key="RectangleFilledStyle" TargetType="Rectangle"  BasedOn="{StaticResource GAScatterBulletStyle}" >
        <Setter Property="RadiusX" Value="0"></Setter>
        <Setter Property="RadiusY" Value="0"></Setter>
        <Setter Property="Fill" Value="Red"></Setter>
        <Setter Property="StrokeThickness" Value="1"></Setter>
        <Setter Property="Stroke" Value="Black"></Setter>

Last edited May 31, 2016 at 8:37 PM by gravityapps, version 11