![ChartTextAboveBar.png ChartTextAboveBar.png](http://blogs.microsoft.co.il/blogs/dudin/Silverlight/ChartTextAboveBar.png)
רכיב Microsoft.Windows.Controls.DataVisualization של Silverlight 4 כולל Charts - גרפים:בכדי להציג את הערכים מעל ה-Bars, ניתן לממש באופן הבא בקובץ ה-XAML (קטע חלקי):
xmlns:charting="clr-namespace:Microsoft.Windows.Controls.DataVisualization.Charting;
assembly=Microsoft.Windows.Controls.DataVisualization"<charting:Chart.Series>
<charting:ColumnSeries ItemsSource="{Binding}" DependentValueBinding="{Binding Value}"
IndependentValueBinding="{Binding Key}">
<charting:ColumnSeries.DataPointStyle>
<Style TargetType="charting:ColumnDataPoint">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:ColumnDataPoint">
<Border Background="Navy" ToolTipService.ToolTip="{Binding Value}"
BorderBrush="{TemplateBinding orderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<TextBlock x:Name="ColumnValue" Text="{Binding Value}" TextAlignment="Center"
HorizontalAlignment="Stretch" Margin="0,-14,0,0" Foreground="Black" FontSize="10" /> Read more: Dudi Nissan's Blog
QR:![silverlight-4-datavisualization-chart-control-how-to-place-values-above-the-bar.aspx silverlight-4-datavisualization-chart-control-how-to-place-values-above-the-bar.aspx](https://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://blogs.microsoft.co.il/blogs/dudin/archive/2011/07/06/silverlight-4-datavisualization-chart-control-how-to-place-values-above-the-bar.aspx)
assembly=Microsoft.Windows.Controls.DataVisualization"<charting:Chart.Series>
<charting:ColumnSeries ItemsSource="{Binding}" DependentValueBinding="{Binding Value}"
IndependentValueBinding="{Binding Key}">
<charting:ColumnSeries.DataPointStyle>
<Style TargetType="charting:ColumnDataPoint">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:ColumnDataPoint">
<Border Background="Navy" ToolTipService.ToolTip="{Binding Value}"
BorderBrush="{TemplateBinding orderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<TextBlock x:Name="ColumnValue" Text="{Binding Value}" TextAlignment="Center"
HorizontalAlignment="Stretch" Margin="0,-14,0,0" Foreground="Black" FontSize="10" /> Read more: Dudi Nissan's Blog
QR:
0 comments:
Post a Comment