Silverlight Chart: Displaying Data Above the Column
Columnseries bar value in top of the column in silverlight chart:
Your final output will come like this
XAML code:
Add the following xaml code in your chart
<toolkit:Chart Canvas.Top="80" Canvas.Left="10" x:Name="chartname" Margin="88,68,312,114">
<toolkit:Chart.Series>
<toolkit:ColumnSeries Title="week1" IndependentValueBinding="{Binding Path=Value}" DependentValueBinding="{Binding Path=Key}">
<toolkit:ColumnSeries.DataPointStyle>
<Style TargetType="toolkit:DataPoint">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="toolkit:ColumnDataPoint">
<Grid Background="{TemplateBinding Background}">
<TextBlock Text="{TemplateBinding FormattedDependentValue}" FontWeight="Bold" Margin="0,-15,0,0" HorizontalAlignment="Stretch"
TextAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</toolkit:ColumnSeries.DataPointStyle>
</toolkit:ColumnSeries>
</toolkit:Chart.Series>
</toolkit:Chart>
The above Red color code is for to display your data on top. see the following image
For refrence http://msmvps.com/blogs/deborahk/archive/2011/02/19/silverlight-charting-displaying-data-above-the-column.aspx
Comments
Post a Comment