Hey,
I've been trying to create a tooltip for a PieDataPoint, but had a couple of difficulties.
Basically, I would like to use the standard tooltip, but I could only find examples showing overriding the tooltip template for this cause. So I tried to create a similar template myself - which caused some bugs.
Mainly, I couldn't get the tooltip size to change according the content (like the strings lengths in the texblocks, I guess it'll be clearer in the xaml).
Another bug (I Believe it's another symptom of the same bug) - inside the tooltip I used a GridRows with Auto height. It seems like it calculates the row's height correctly only the second time it shows the tooltip.
This is the xaml:
Is there any way to use WPF default tooltip? If not, What am I doing wrong?
I've been trying to create a tooltip for a PieDataPoint, but had a couple of difficulties.
Basically, I would like to use the standard tooltip, but I could only find examples showing overriding the tooltip template for this cause. So I tried to create a similar template myself - which caused some bugs.
Mainly, I couldn't get the tooltip size to change according the content (like the strings lengths in the texblocks, I guess it'll be clearer in the xaml).
Another bug (I Believe it's another symptom of the same bug) - inside the tooltip I used a GridRows with Auto height. It seems like it calculates the row's height correctly only the second time it shows the tooltip.
This is the xaml:
<
telerik:RadPieChart
Palette
=
"Windows8"
Grid.Column
=
"0"
Name
=
"PieChart"
>
<
telerik:PieSeries
ValueBinding
=
"Value"
ShowLabels
=
"True"
RadiusFactor
=
"0.6"
IsHitTestVisible
=
"True"
ItemsSource
=
"{Binding PieData}"
>
<
telerik:PieSeries.LabelDefinitions
>
<
telerik:ChartSeriesLabelDefinition
Margin
=
"-10,0,0,0"
Binding
=
"Label"
HorizontalAlignment
=
"Center"
/>
</
telerik:PieSeries.LabelDefinitions
>
<
telerik:PieSeries.LegendSettings
>
<
telerik:DataPointLegendsSettings
TitleBinding
=
"Legend"
/>
</
telerik:PieSeries.LegendSettings
>
<
telerik:PieSeries.AngleRange
>
<
telerik:AngleRange
StartAngle
=
"270"
SweepAngle
=
"360"
/>
</
telerik:PieSeries.AngleRange
>
<
telerik:PieSeries.LabelConnectosSettings
>
<
telerik:ChartSeriesLabelConnectorsSettings
/>
</
telerik:PieSeries.LabelConnectosSettings
>
</
telerik:PieSeries
>
<
telerik:RadPieChart.Behaviors
>
<
telerik:ChartTooltipBehavior
/>
</
telerik:RadPieChart.Behaviors
>
<
telerik:RadPieChart.SmartLabelsStrategy
>
<
telerik:PieChartSmartLabelsStrategy
DisplayMode
=
"SpiderUnaligned"
/>
</
telerik:RadPieChart.SmartLabelsStrategy
>
<
telerik:RadPieChart.TooltipTemplate
>
<
DataTemplate
>
<
Border
BorderBrush
=
"#FFA0AFC3"
BorderThickness
=
"1"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
Grid.Background
>
<
LinearGradientBrush
EndPoint
=
"0.5,1"
StartPoint
=
"0.5,0"
>
<
GradientStop
Color
=
"#FFFDFEFF"
Offset
=
"0"
/>
<
GradientStop
Color
=
"#FFDDE9F7"
Offset
=
"1"
/>
</
LinearGradientBrush
>
</
Grid.Background
>
<
TextBlock
Text
=
"{Binding DataItem.ToolTipTitle}"
Grid.Row
=
"0"
Opacity
=
"0.56"
FontSize
=
"13"
HorizontalAlignment
=
"Left"
MaxWidth
=
"340"
FontWeight
=
"Bold"
TextWrapping
=
"Wrap"
/>
<
TextBlock
Text
=
"{Binding DataItem.ToolTipContent}"
Grid.Row
=
"1"
FontSize
=
"12"
HorizontalAlignment
=
"Left"
MaxWidth
=
"340"
TextWrapping
=
"Wrap"
/>
</
Grid
>
</
Border
>
</
DataTemplate
>
</
telerik:RadPieChart.TooltipTemplate
>
</
telerik:RadPieChart
>
Is there any way to use WPF default tooltip? If not, What am I doing wrong?