【发布时间】:2013-03-18 16:44:17
【问题描述】:
默认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>
【问题讨论】:
标签: .net silverlight xaml styles