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

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

1 Answer 55 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Gert Van Meerbergen
Top achievements
Rank 1
Gert Van Meerbergen asked on 19 Aug 2015, 01:42 PM

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

@(Html.Kendo().Chart().Name("CompetenceEvolution")

.SeriesDefaults(sd => sd.Line().Style(ChartLineStyle.Smooth))
.Series(series =>
{
foreach (var data in Model.EvolutionChartData)
{
series.Line(data.Items).Field("Score").CategoryField("AssessmentDate").Name(data.Name);
}
})

.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.
           

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 21 Aug 2015, 07:58 AM
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 categoryAxis.
For your convenience I prepared a dojo example - please check it and let me know if this fits the current requirements.

Regards,
Iliana Nikolova
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
Tags
Chart
Asked by
Gert Van Meerbergen
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or