Line chart year date axis but use real date to plot points

2 posts, 0 answers
  1. Gert Van Meerbergen
    Gert Van Meerbergen avatar
    6 posts
    Member since:
    Sep 2006

    Posted 19 Aug 2015 Link to this post

    I want to use the date category axis which should only show years:


    .SeriesDefaults(sd => sd.Line().Style(ChartLineStyle.Smooth))
    .Series(series =>
    foreach (var data in Model.EvolutionChartData)

    .CategoryAxis(axis => axis.Date().BaseUnit(ChartAxisBaseUnit.Years))


    but I would like that for plotting the points the real date is used (now the point is placed above the category label), but is should be placed according to the date. Because now, when having two different items in the same year (with a different date), only one item is getting plotted to the chart.

  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 21 Aug 2015 Link to this post

    Hi Gert,

    When date axis is used the data is aggregated for a particular period. In order to plot multiple points for each year I would suggest the following approach:
    - Use two category axes - one with baseUnit "days", the other one with baseUnit "years";
    - Hide the days-based categoryAxis.
    For your convenience I prepared a dojo example - please check it and let me know if this fits the current requirements.

    Iliana Nikolova
    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