0

I have a pb customizing the data Points of my line Series. I tried to use the examples used to collapse the data Points by setting my customized template but,if i customize the datapoint template the line series disappears and only the datapoints are shown.

Here is a part of my the curve style:

  <visualizationToolkit:ResourceDictionaryCollection x:Key="ChartPaletteDataPoints">
            <!-- Curve 1 -->
            <ResourceDictionary>
                <Style x:Key="DataPointStyle" TargetType="Control" >
                    <Setter Property="Background" Value="{Binding Data.Children[0].Color, Source={StaticResource proxyCurv}}" />
                    <Setter Property="Width" Value="19" />
                    <Setter Property="Height" Value="19" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="chartingToolkit:LineDataPoint">
                                <Grid x:Name="Root">
                                    <ToolTipService.ToolTip>
                                        <StackPanel Orientation="Horizontal" >
                                            <Label Content="("/>
                                            <Label Content="{TemplateBinding IndependentValue}"/>
                                            <Label Content=","/>
                                            <Label Content="{TemplateBinding DependentValue}"/>
                                            <Label Content=")"/>
                                        </StackPanel>
                                    </ToolTipService.ToolTip>
                                    <Label Margin="3,3,0,0" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" >
                                        <Label.Content>
                                            <MultiBinding Converter="{StaticResource GroupSymbolToShapeConverter}">
                                                <Binding Path="Data.Children[0].Symbol" Source="{StaticResource proxyCurv}"/>
                                                <Binding Path="Data.Children[0].Color" Source="{StaticResource proxyCurv}"/>
                                            </MultiBinding>
                                        </Label.Content>
                                    </Label>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style x:Key="DataShapeStyle" TargetType="Shape">
                    <Setter Property="Stroke" Value="{Binding Data.Children[0].Color, Source={StaticResource proxyCurv}}" />
                    <Setter Property="StrokeThickness" Value="2" />
                    <Setter Property="StrokeMiterLimit" Value="1" />
                    <Setter Property="Fill" Value="{Binding Data.Children[0].Color, Source={StaticResource proxyCurv}}" />
                </Style>
            </ResourceDictionary>
    <!--Other Curves...-->
    </visualizationToolkit:ResourceDictionaryCollection>

PS: The GroupSymbolToShapeConverter returns a shape object containing the shape of the datapoint.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
  • It would be useful if you indented your XML blob a bit to make it more readable. – Trygve Laugstøl Jan 04 '13 at 15:50
  • The line disapperas because the style with key 'DataShapeStyle' is incorrect. Something may be wrong with binding, I don't know exactly, but I know that everything will work fine if you remove this style completely. – vortexwolf Jan 06 '13 at 20:01
  • If i remove this style i won t be able to customize my datapoints. Nothing is wrong with binding, because the correct values of colors and shapes are shown. What i don t understand is why the line disappear when i customize the datapoint? – user1948874 Jan 07 '13 at 12:40
  • @user1948874 The style that customizes data point is called "DataPointStyle". The line disappears because your "DataShapeStyle" is incorrect. – vortexwolf Jan 10 '13 at 17:48
  • @vorrtex In Fact, i deleted the "datashapestyle", and it doesn't change anything. I figured out that the lines appear only when the curve already exist when i open the view(chart). But if i open the chart with no curves and points then add curves and points(via databinding) to the chart, the line doesn't appear. Maybe because the palette charts style is set only at the opening of the view, i can only add it on a static mode (StaticResource) – user1948874 Jan 11 '13 at 10:00

0 Answers0