I have RadCartesianChart and i am create the AreaSeries view code behind:
RadCartesianChart chart =
new
RadCartesianChart();
chart.HorizontalAxis =
new
CategoricalAxis();
chart.VerticalAxis =
new
LinearAxis();
chart.HorizontalAxis.Visibility = System.Windows.Visibility.Collapsed;
chart.VerticalAxis.Visibility = System.Windows.Visibility.Collapsed;
// Get the style
Style smartLabelStyle = (Style)
this
.Resources[
"labelStyle"
];
// Create new labelDefinition and set its DefaultVisualStyle property
ChartSeriesLabelDefinition labelDefinition =
new
ChartSeriesLabelDefinition()
{
DefaultVisualStyle = smartLabelStyle,
Format =
"{0:N2}"
,
Margin =
new
Thickness(-40, 0, 0, 0)
};
MyInstanse =
new
AreaSeries();
// this is my series
MyInstanse .ShowLabels =
true
;
MyInstanse .LabelDefinitions.Add(labelDefinition);
chart.Series.Add(MyInstanse);
And
this
is
my XAML label style:
<Style x:Key=
"labelStyle"
TargetType=
"TextBlock"
>
<Setter Property=
"Foreground"
Value=
"Gainsboro"
/>
<Setter Property=
"Background"
Value=
"Transparent"
/>
</Style>So all i want to add is border around my Label like in this example:
http://docs.telerik.com/devtools/wpf/controls/radchartview/features/labels/smart-labels.html