I need to create e polar chart showing markers for every series of data. Each series has only one point and I need to show a tooltip like this:
I've modified the Polar Chart example in Essential Studio to create the chart like the one I need but I'm not able to show the tooltip. Seems ToolTip are meant to show only over a chart segment and not a data point.
The chart I've created is this:
Hovering on markers (or selecting a data point ) I need to show the tooltip. I've tried with this data template used as ToolTipTemplate for each PolarSeries but is not showing:
<DataTemplate x:Key="ChartTooltipTemplate">
<Border BorderThickness="1" BorderBrush="Black" Background="LightBlue" CornerRadius="3">
<StackPanel Margin="3">
<StackPanel Orientation="Horizontal">
<TextBlock Text="XValue : " FontSize="14" FontWeight="Bold"/>
<TextBlock Text="{Binding Item.Direction}" FontSize="14" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="YValue : " FontSize="14" FontWeight="Bold"/>
<TextBlock Text="{Binding Item.Value}" FontSize="14" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
Thanks
Fabrizio
Hi Yuvaraj,
I've worked on your example integrating my mockup with more series and trying to adapt the code. I've come up with something that is working, there still is some issues with the nearest point but it's working.
The chart.PointToValue(chart.SecondaryAxis, p) to get the Y of the mouse point is getting lower values so I've added a 15% to get an approximate value close enough.
Also your FindNearestChartPoint seem to work only on X values to find the nearest not considering the Y value, I've tried to calculate the points distance to the mouse location to evaluate the nearest and seems to work.
I've attached the project modified if you have any suggestion on how to improve.
Tooltip are working also on polar chart but they show only on segment connecting two point of the same series, the problem in my case is that I have one point per series.
Thanks, bye
Fabrizio
Hi Yuvaraj,
moving the code and xaml tags to the real mock-up I've found out that is not working correctly, I don't know if is due to different layout of the control or the presence of other controls but the minimal errors there was on the sample are becoming big errors in the new mock-up. The procedure linked to chart MouseLeftButtonUp is not working properly, the one I made on series MouseUp is working but the event is not always fired clicking on series markup.
Also should be good to have the ability to hide the ToolTIp i.e. clicking outside the chart area but I can't find a way to do that.
Bye
Fabrizio