默认情况下ColumnSeries.DataPointStyle
非常好,但它的标签不可见。
所以我应用了自定义样式来制作可见的数据点标签,但在此之后,默认样式现在看起来很难看。
如何返回默认数据点样式并同时使数据点标签可见?谢谢你!
这是我的 XAML:
<toolkit:ColumnSeries Title="Male" ItemsSource="{Binding MaleSerie}" IndependentValueBinding="{Binding ItemName}"
DependentValueBinding="{Binding Count}" ToolTipService.ToolTip="{Binding Count}"
AnimationSequence="Simultaneous"
HorizontalAlignment="Left" Height="304" VerticalAlignment="Top" Width="266">
<toolkit:ColumnSeries.DataPointStyle>
<Style TargetType="toolkit:ColumnDataPoint">
<Setter Property="Background" Value="Blue"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="toolkit:ColumnDataPoint">
<Grid>
<Rectangle
Fill="{TemplateBinding Background}"
Stroke="Black"/>
<Grid Background="#aaffffff" Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock FontSize="10" Text="{TemplateBinding FormattedDependentValue}" FontWeight="Bold" Width="Auto" Margin="2"/>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</toolkit:ColumnSeries.DataPointStyle>
</toolkit:ColumnSeries>