Hi,
I'm creating a chart that is based off the MeteoChart example. Specifically, I'm using the same concepts as the SplineLabelStyle in the MeteoChart to display custom icons overriding the default item label.
The MeteoChart has the following XAML to style the SeriesItemLabel with a custom control template that contains custom icons:
What I'd like to do is add a tooltip to this image to display more information, ie:
The problem is that the above XAML doesn't work. While the example runs, tooltips are not displayed when hovering over the icon. I've tried shifting the tooltip to the canvas instead and even tried displaying fixed text as the tooltip, however none of these alternatives get tooltips to display.
I would like to display the tooltip on the customized item label because:
I'm creating a chart that is based off the MeteoChart example. Specifically, I'm using the same concepts as the SplineLabelStyle in the MeteoChart to display custom icons overriding the default item label.
The MeteoChart has the following XAML to style the SeriesItemLabel with a custom control template that contains custom icons:
<
Style
x:Key
=
"SplineLabelStyle"
TargetType
=
"charting:SeriesItemLabel"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"charting:SeriesItemLabel"
>
<
Canvas
>
<
Border
x:Name
=
"PART_TextContainer"
>
<
Image
x:Name
=
"PART_Image"
Source
=
"{Binding DataItem.WeatherImageSource}"
/>
</
Border
>
</
Canvas
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
What I'd like to do is add a tooltip to this image to display more information, ie:
<
Style
x:Key
=
"SplineLabelStyle"
TargetType
=
"charting:SeriesItemLabel"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"charting:SeriesItemLabel"
>
<
Canvas
>
<
Border
x:Name
=
"PART_TextContainer"
>
<
Image
x:Name
=
"PART_Image"
Source
=
"{Binding DataItem.WeatherImageSource}"
ToolTip
=
"{Binding DataItem.WeatherConditions}"
/>
</
Border
>
</
Canvas
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
The problem is that the above XAML doesn't work. While the example runs, tooltips are not displayed when hovering over the icon. I've tried shifting the tooltip to the canvas instead and even tried displaying fixed text as the tooltip, however none of these alternatives get tooltips to display.
I would like to display the tooltip on the customized item label because:
- these labels are easier targets to hover over instead of point marks,
- the labels are displayed in a different location to the point mark, and finally
- I'm actually hiding the point mark in my actual scenario (I'm just displaying the icons).
How can I define tooltips for custom item labels?
Alternatively, how can I customize the PointMarkItemStyle to display custom icons (and then I can use the default item tooltip provided).
Kind regards,
Dave.