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

Spline series

1 Answer 116 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Olaf Meyer
Top achievements
Rank 1
Olaf Meyer asked on 24 Apr 2016, 05:49 PM

Hello,

I'm currently evaluation the chart control and tried to draw a spline line. The result looks odd (see attached screenshot). I would expect a line as shown in the second attachment.

These are the point of spline:

this.DataContext = new List<ChartData>()
{
new ChartData { XVal = 1, YVal = 0.2 },
new ChartData { XVal = 2, YVal = 0.259 },
new ChartData { XVal = 15, YVal = 2.884 },
new ChartData { XVal = 25, YVal = 5.15 },
new ChartData { XVal = 40.3, YVal = 8.73 },
new ChartData { XVal = 50, YVal = 9.9 },
};

It seems there is a problem with the slope. Is there a way to set the start slope?

Best Regards

Olaf

 

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 26 Apr 2016, 07:14 AM
Hello Olaf,

The chart uses the Canonical Spline Algorithm for the spline series. What you see is a direct result of the algorithm. You can get some information here and play with this live demo here. I have attached an image of the output I get when I use the live demo with points similar to your data. You can see that the result is essentially the same, due to the nature of the splines.

At this moment we do not have an API that would allow you to change the tension, but even if there was a way to do that, you would still get a swirl in the bottom left corner unless you decrease the tension to almost get a straight line everywhere else. We can suggest not to use splines, use a LineSeries. An alternative to the spline would be to manually create more data points and again use a LineSeries. This way you can implement your own algorithm for splining.

Regards,
Petar Marchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Chart
Asked by
Olaf Meyer
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or