Using the RangeBarSeries with data points that overlap another series, the tooltip for the covered up data point is shown rather than the one on top.
However the "hover" clearly knows which is the series being hovered over. See attached screenshots. chart1.pg shows the longest (yellow) bar being hovered over. chart2.png shows the adjacent orange series and chart3 shows the green series. All 3 have the same tooltip, of the longest series which runs underneath the others.
How can I fix this and get the tooltips to show for the proper data point?
7 Answers, 1 is accepted
Thank you for the provided image files.
Using the provided information I tried to reproduce this behavior but to no avail. Attached to this reply you can find the project which I used to test your scenario. When you run the project you can observe 3 RangeBarSeries with CombineMode set to None. The longest one is the first one (Green RangeBarSeries). The shortest one is on the top and it is in Red color. When I hover either of the three series the ToolTip shows the correct value. May I ask you to take a look at this project and let me know if I am missing something for your implementation.
Looking forward to your reply.
Regards,
Dinko
Progress Telerik
Yeah, that's the problem. Just flip the order of the series and set the zindex values. e.g.:
<telerik:RadCartesianChart.Series>
<telerik:RangeBarSeries CombineMode="None" ItemsSource="{Binding Data3}" ZIndex="5"
CategoryBinding="StationName"
LowBinding="LowerBoundary"
HighBinding="UpperBoundary"
ShowLabels="True" >
<telerik:RangeBarSeries.DefaultVisualStyle>
<Style TargetType="Border">
<Setter Property="Background" Value="Red"/>
</Style>
</telerik:RangeBarSeries.DefaultVisualStyle>
</telerik:RangeBarSeries>
<telerik:RangeBarSeries CombineMode="None" ItemsSource="{Binding Data2}" ZIndex="3"
CategoryBinding="StationName"
LowBinding="LowerBoundary"
HighBinding="UpperBoundary"
ShowLabels="True" >
<telerik:RangeBarSeries.DefaultVisualStyle>
<Style TargetType="Border">
<Setter Property="Background" Value="Blue"/>
</Style>
</telerik:RangeBarSeries.DefaultVisualStyle>
</telerik:RangeBarSeries>
<telerik:RangeBarSeries CombineMode="None" ItemsSource="{Binding Data}" ZIndex="1"
CategoryBinding="StationName"
LowBinding="LowerBoundary"
HighBinding="UpperBoundary"
ShowLabels="True">
<telerik:RangeBarSeries.DefaultVisualStyle>
<Style TargetType="Border">
<Setter Property="Background" Value="Green"/>
</Style>
</telerik:RangeBarSeries.DefaultVisualStyle>
</telerik:RangeBarSeries>
</telerik:RadCartesianChart.Series>
Also, I think it's a bug that you have to set the zindex in steps of 2 for it to work.
Thank you for the provided code snippet.
I understand the case now. The ToolTip behavior works with the position of the series as they are added to the chart. The ZIndex property is not respected when using ToolTip behavior. What I can suggest you is to avoid using the ZIndex property and add the series to the chart as the longest one is at the bottom.
Regards,
Dinko
Progress Telerik
This sounds like a bug to me. You obviously know which is the proper data point from the zindex for the hover selection.
Is there any way for me to override the hit testing so that I can just determine on my own which data point is associated?
I need to be able to do this in order to control the order of the legend, unless there is some alternative means of the order in the legend?
After further discussion with the team, you are right that the ZIndex property should be respected. Therefore I have logged it in our Feedback Portal where you can track its progress.
What I can suggest you control the order of the legend items is to subscribe to the Loaded event of the RadLegend. In the event handler, you can create your own collection with a specific order of the items and set it to the Items property of the legend.
private
void
RadLegend_Loaded(
object
sender, RoutedEventArgs e)
{
var legend = sender
as
RadLegend;
var reversedItems = legend.Items.Reverse();
var newItems =
new
LegendItemCollection();
foreach
(LegendItem item
in
reversedItems)
{
newItems.Add(item);
}
legend.Items = newItems;
}
Regards,
Dinko
Progress Telerik