SplineSeries go only "forward"

4 posts, 0 answers
  1. Adam
    Adam avatar
    4 posts
    Member since:
    Aug 2015

    Posted 08 Feb Link to this post

    Hi guys, i have big problem with SplineSeries on RadCartesianChart.

    I have DateTimeContinuousAxis on my X axis and LinearAxis on my Y axis.

    I want to make average line using SplineSeries but i have problem with drawing it properly.

    In attach i created 2 series of data:
    LineSeries (BlackLine) and SplineSeries (RedLine)

    Both of them are binded to the same collection of data.

    And now, i don't know why, SplineSeries go back and then forward, how i can archive line like LineSeries but more rounded? (I Want to SplineSeries go only forward).

    I founded this link on Google but it's doesnt work:
    http://marketplace.telerik.com/forums/spline-series---only-go-forward

  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 09 Feb Link to this post

    Hello Adam,

    The chart control draws the line between the series' data points following the order in the source collection. For example, if you have items with X values 4, 1, 3, 5 which are ordered in the same way on the ItemsSource collection, the line will start to draw from 4, then return to 1, after this goes to 3 and end at 5.

    In order to achieve your requirement you will need to order the source collection by the X value of its items. If the horizontal (X) axis is categorical you can order the collection by distinct categories. Please try this an let me know if it works for you.

    Regards,
    Martin
    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Adam
    Adam avatar
    4 posts
    Member since:
    Aug 2015

    Posted 09 Feb Link to this post

    Hi,

    My X axis is DateTimeContinuousAxis and the source collection is ordered by dates (from smalles to largest (black line on the chart proves that because is binded to the same data as SplineLine)).

    The problem appears when between points is a big gap like on the screen:
    21.07 - before this date is a loot of points, then is a big gap until 24.08

  5. Dinko
    Admin
    Dinko avatar
    206 posts

    Posted 12 Feb Link to this post

    Hi Adam,

    We must have misunderstood you in your first post. Basically, the spline series use a canonical spline algorithm with a certain tension. You can read about the canonical splines here and see a demo here. We have not exposed any splining options and it is not possible to customize the splining in any way. We have such a feature request in our feedback portal, where you can vote and track its status.

    Splines are not an adequate presentation for all cases, and we think that you have stumbled upon a scenario where you would be better off using a simple line.

    Regards,
    Dinko
    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
Back to Top