This is a migrated thread and some comments may be shown as answers.

RangeBarSeries shows wrong tooltip

7 Answers 39 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 15 Feb 2019, 02:28 AM

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

Sort by
0
Dinko
Telerik team
answered on 19 Feb 2019, 01:00 PM
Hi Steve,

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Steve
Top achievements
Rank 1
answered on 19 Feb 2019, 01:56 PM
A detail that I forgot about was that to get the items in the correct order in the legend, we add them in reverse order and use the zorder to put the smaller bars on top.
0
Steve
Top achievements
Rank 1
answered on 20 Feb 2019, 03:55 AM

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.

0
Dinko
Telerik team
answered on 22 Feb 2019, 10:00 AM
Hi Steve,

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Steve
Top achievements
Rank 1
answered on 22 Feb 2019, 04:33 PM

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?

0
Accepted
Dinko
Telerik team
answered on 27 Feb 2019, 12:47 PM
Hi Steve,

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Steve
Top achievements
Rank 1
answered on 01 Mar 2019, 03:23 AM
Thanks, I was able to use that to arrange my legend how I needed, and no longer need to use the zindex.
Tags
ChartView
Asked by
Steve
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Steve
Top achievements
Rank 1
Share this question
or