我在WPF应用程序中使用Labeled Pie Chart。饼图标签出现两次。请找到附带的屏幕截图。 [![在此处输入图像说明] [1]] [1]
Offline-8是唯一应该出现的标签。 请找到以下代码
<DataTemplate DataType="{x:Type local:CentralPiePanel}" x:Key="pieChartLabelDataTemplate">
<Border BorderThickness="0" BorderBrush="White">
<StackPanel Background="White" Orientation="Horizontal">
<!--<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type customcontrols:PieChartLabel}},Path = FormattedRatio}" VerticalAlignment="Center" Margin="5,0,5,0">
</TextBlock>-->
<!--<TextBlock Text=" - "></TextBlock>-->
<TextBlock Text="{Binding Key}" Margin="0,0,5,0"></TextBlock>
<TextBlock Text="-"></TextBlock>
<TextBlock Text="{Binding Value}" Margin="0,0,5,0"></TextBlock>
</StackPanel>
</Border>
</DataTemplate>
enter code here
<customcontrols:LabeledPieChart Loaded="EGMLabelChart_Loaded" Height="270" x:Name="ControllerLabelChart" BorderThickness="0" Grid.Column="0" BorderBrush="White" Margin="2 2 2 2" Palette="{StaticResource OnlineOfflineStatusPalette}">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="MouseLeftButtonUp">
<interactivity:InvokeCommandAction Command="{Binding PieSelectionChangeCommand}" CommandParameter="{x:Static dashboard:PieType.CONTROLLERS}"/>
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
<customcontrols:LabeledPieSeries x:Name="ControllerLabelPieSeries" Margin="0" ItemsSource="{Binding ControllersStatus}" IndependentValueBinding="{Binding Key}" DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" PieChartLabelStyle="{StaticResource pieChartLabelStyle}" PieChartLabelItemTemplate="{StaticResource pieChartLabelDataTemplate}"
LabelDisplayMode="Connected"></customcontrols:LabeledPieSeries>
</customcontrols:LabeledPieChart>