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

ChartView Path SplineAreaSeries

2 Answers 56 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 21 Jun 2015, 02:34 AM

So I am using RadCartesianChart with SplineAreaSeries to simulate the oceans tide. I am using DateTimeContinuousAxis as my horizontal value and the tide height as my vertical value. The chart draws great curves, but I cannot find a way to get the path details from the chart that is drawn. What I am trying to do is have an object move itself across the Spline on a timed interval. The object will show the tides height in the middle of it.

So here are my questions.

->Is there a way to find out the vertical intersection point given the horizontal value. chart.series.GetVerticalValue(HorizontalValue); So if I provide a DateTime, it will give me the vertical height value.

-> If not, are there any other ways to find out intersection points of the spline or the drawn path itself? If I could get access to that then I can duplicate a path for my object to follow.

--------------------------------------

Attached is the closest that I have come. The SplineChart is draw in blue, then I have automatically calculated the tide height at timed intervals(Green) and have the annotation follow it, but just can't make it curve to follow.

 

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Marchev
Telerik team
answered on 22 Jun 2015, 08:29 AM
Hello Peter,

We have not introduced public methods that will work in the desired way. There is no equivalent to the GetVerticalValue method that you need.

The spline series uses the same algorithm as the canonical splines, so if you were to code this algorithm on your own, you could predict where the vertical value is (for a given horizontal value.
canonical splines blog
demo here (download demo here)

An alternative is to get the Path element of the spline series and get its Data. From the path geometry you should be able to find all the segments and points of the spline curve.

I hope this information is helpful, let us know how it goes.

Regards,
Petar Marchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Peter
Top achievements
Rank 1
answered on 23 Jun 2015, 12:11 AM

Thanks Petar!

 The Spline Series Algorithm you posted the link to did the job. I modified the library to exposed the PathGeomotry in a dependency object and binded right to it.

 Thank you!

 

 

 

 

Tags
ChartView
Asked by
Peter
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Peter
Top achievements
Rank 1
Share this question
or