0

我有一个自定义我的线系列的数据点的 pb。我尝试通过设置我的自定义模板来使用用于折叠数据点的示例,但是,如果我自定义数据点模板,则线系列消失并且只显示数据点。

这是我的曲线样式的一部分:

  <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:GroupSymbolToShapeConverter返回一个包含数据点形状的形状对象。

4

0 回答 0