Spline series

2 posts, 0 answers
  1. Olaf Meyer
    Olaf Meyer avatar
    6 posts
    Member since:
    Nov 2009

    Posted 24 Apr Link to this post


    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



  2. Petar Marchev
    Petar Marchev avatar
    968 posts

    Posted 26 Apr Link to this post

    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.

    Petar Marchev
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top