Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

How can i change the thickness of a LineDataPoint? RSS

2 replies

Last post Mar 03, 2009 10:28 AM by lee_sl

(0)
  • Dragon160

    Dragon160

    0 Points

    1 Post

    How can i change the thickness of a LineDataPoint?

    Mar 03, 2009 08:47 AM | LINK

     Hi everyone,

    i'am new here and i'am trying to implement a LineChart which contains a lot(!) of datapoints (and LineSeries).

    So, at the moment the normal "fat" datapoint covers the other lines -> i can't see anything ;)

    This is my Code (one of 10 LineSeries):

     

                    <charting:LineSeries  
                        IsSelectionEnabled="True"  
                        IndependentValueBinding="{Binding Date}"
                        DependentValueBinding="{Binding Value}"  >
                        <charting:LineSeries.PolylineStyle>
                            <Style x:Key="GooglePolylineStyle" TargetType="Polyline">
                                <Setter Property="StrokeThickness" Value="1"/>
                            </Style>
                        </charting:LineSeries.PolylineStyle>                    
                        <charting:LineSeries.DataPointStyle>
                           <Style TargetType="charting:LineDataPoint">
                                <Setter Property="Background" Value="#0077CC" />
                                <Setter Property="BorderThickness" Value="0"/>
                                <Setter Property="IsTabStop" Value="False"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="charting:LineDataPoint">
                                            <Grid x:Name="Root" Opacity="1">                                           
                                                <ToolTipService.ToolTip>
                                                    <StackPanel Margin="2,2,2,2">
                                                        <ContentControl Content="{TemplateBinding IndependentValue}" />
                                                        <ContentControl Content="{TemplateBinding DependentValue}"/>
                                                    </StackPanel>
                                                </ToolTipService.ToolTip>
                                                <Ellipse StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </charting:LineSeries.DataPointStyle>
                    </charting:LineSeries>
    

     
    Is there something like that, but for the DataPoint Thickness?

     

                        <charting:LineSeries.PolylineStyle>
                            <Style x:Key="GooglePolylineStyle" TargetType="Polyline">
                                <Setter Property="StrokeThickness" Value="1"/>
                            </Style>
                        </charting:LineSeries.PolylineStyle>                    
     

      

    mfg (german: greetings)

     Dragon

    silverlight toolkit LineChar DataPoint Thickness

  • lee_sl

    lee_sl

    Contributor

    4222 Points

    864 Posts

    Re: How can i change the thickness of a LineDataPoint?

    Mar 03, 2009 10:28 AM | LINK

    you can create a style like this  and set the style of the line series

    <Style x:Key="st3" TargetType="charting:LineSeries">

    <Setter Property="IsTabStop" Value="False" />

    <Setter Property="MarkerWidth" Value="4" />

    <Setter Property="MarkerHeight" Value="4" />

    <Setter Property="PolylineStyle">

    <Setter.Value>

    <Style TargetType="Polyline">

    <Setter Property="StrokeThickness" Value="1" />

    </Style>

    </Setter.Value>

    </Setter>

    <Setter Property="Template">

    <Setter.Value>

    <ControlTemplate TargetType="charting:LineSeries">

    <Canvas x:Name="PlotArea">

    <Polyline Points="{TemplateBinding Points}" Stroke="{TemplateBinding Background}" Style="{TemplateBinding PolylineStyle}" />

    </Canvas>

    </ControlTemplate>

    </Setter.Value>

    </Setter>

    </Style>

    <charting:LineSeries mTitle="Orders" DataPointStyle="{StaticResource st2}" Style="{StaticResource st3}"

    ItemsSource="{Binding LevelsInRainfall, Source={StaticResource ParticulateLevel}}"

    IndependentValueBinding="{Binding OrderDate}"

    DependentValueBinding="{Binding Count}" />

    ----------------------------------------------
    Available for consulting in Dallas, TX
    http://leeontech.wordpress.com/
  • lee_sl

    lee_sl

    Contributor

    4222 Points

    864 Posts

    Re: How can i change the thickness of a LineDataPoint?

    Mar 03, 2009 10:28 AM | LINK

    you can create a style like this  and set the style of the line series

    <Style x:Key="st3" TargetType="charting:LineSeries">

    <Setter Property="IsTabStop" Value="False" />

    <Setter Property="MarkerWidth" Value="4" />

    <Setter Property="MarkerHeight" Value="4" />

    <Setter Property="PolylineStyle">

    <Setter.Value>

    <Style TargetType="Polyline">

    <Setter Property="StrokeThickness" Value="1" />

    </Style>

    </Setter.Value>

    </Setter>

    <Setter Property="Template">

    <Setter.Value>

    <ControlTemplate TargetType="charting:LineSeries">

    <Canvas x:Name="PlotArea">

    <Polyline Points="{TemplateBinding Points}" Stroke="{TemplateBinding Background}" Style="{TemplateBinding PolylineStyle}" />

    </Canvas>

    </ControlTemplate>

    </Setter.Value>

    </Setter>

    </Style>

    <charting:LineSeries mTitle="Orders" DataPointStyle="{StaticResource st2}" Style="{StaticResource st3}"

    ItemsSource="{Binding LevelsInRainfall, Source={StaticResource ParticulateLevel}}"

    IndependentValueBinding="{Binding OrderDate}"

    DependentValueBinding="{Binding Count}" />

    ----------------------------------------------
    Available for consulting in Dallas, TX
    http://leeontech.wordpress.com/