Intersect point of 2 series on RadCartesianChart

1 Answer 24 Views
Chart ChartView
Hadrian
Top achievements
Rank 1
Hadrian asked on 26 Mar 2024, 12:34 PM

Hi,

I am exploring the RadCartesianChart component and would like to know if there is a way to determine the intersection point between two series. For example, I have a SplineSeries and a LineSeries, and I would like to know where they intersect. Is there a component or method to accomplish this?

I may be using the wrong component to try to achieve that?

 <telerik:RadCartesianChart x:Name="telerikChart">

     <telerik:RadCartesianChart.VerticalAxis>
         <telerik:LinearAxis Title="Distance (m)" DesiredTickCount="10"/>
     </telerik:RadCartesianChart.VerticalAxis>

     <telerik:RadCartesianChart.HorizontalAxis>
         <telerik:DateTimeContinuousAxis Title="Time (HH:mm)" LabelFormat="HH:MM" 
                                         TickOrigin="{Binding Origin}" MaximumTicks="14" MajorStepUnit="Hour" MajorStep="1"
                                         Minimum="{Binding Minimum}" Maximum="{Binding Maximum}" />
     </telerik:RadCartesianChart.HorizontalAxis>

     <telerik:RadCartesianChart.Series>
         <telerik:SplineSeries x:Name="barSerie1" CategoryBinding="Time" ValueBinding="Distance" ItemsSource="{Binding DistanceSeries}" ShowLabels="True" />
         <telerik:LineSeries x:Name="barSerie2" CategoryBinding="Time" ValueBinding="Distance" ItemsSource="{Binding AverageLineSeries}" ShowLabels="True"/>
     </telerik:RadCartesianChart.Series>

     <telerik:RadCartesianChart.Grid>
         <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
     </telerik:RadCartesianChart.Grid>

 </telerik:RadCartesianChart>

 

Thanks for your time! 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 27 Mar 2024, 01:11 PM

Hello Hadrian,

The chart doesn't have an API that allows you to get the intersection points between two line series. Can you tell me why do you need to do that?

Regards,
Martin Ivanov
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com
Hadrian
Top achievements
Rank 1
commented on 28 Mar 2024, 11:06 AM

Hello Martin,

What I want to achieve is to generate from the intersection point another series, adding a set of values according to this point.

Martin Ivanov
Telerik team
commented on 29 Mar 2024, 12:46 PM

Thank you for the additional information. I am afraid that there is no proper mechanism that will allow you to do this.
A very custom idea that you can explore is to get the Path visuals that draws the lines in the LineSeries instances with the ChildrenOfType<T> extension method. Then get their geometries and implement an algorithm that finds the intersections between the point collections of the geometries. If you manage to do that, then you can use the Conversion API to convert the geometry screen coordinates to data values on the axes.
Tags
Chart ChartView
Asked by
Hadrian
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or