Creating line chart with the model from Kendo UI line chart

2 posts, 0 answers
  1. Natalia
    Natalia avatar
    2 posts
    Member since:
    Oct 2014

    Posted 30 Dec 2014 Link to this post

    Hi!

    I'm trying to create a line chart report using the same data model which I use in my Kendo UI line chart. The model looks like this:

    public class ChartData
    {
    public DateTime Date { get; set; }
    public int VisitsCount { get; set; }
    public int IdeasCount { get; set; }
    public int CommentsCount { get; set; }
    ...
    }

    The model used by Kendo UI chart has a list of ChartData object. To create a line chart using Kendo UI I have to do something like this:

    @(Html.Kendo().Chart(Model)
    ...
            .Series(series =>
                    {
                            series.Line(model => model.VisitsCount);
                            series.Line(model => model.IdeasCount);
                            series.Line(model => model.CommentsCount);
                    })
            .CategoryAxis(axis => axis.Categories(model => model.Date))
            .ValueAxis(axis => axis.Numeric())
    ...

    How can I add a line chart in the Telerik Reporting framework to achieve the same effect? I have problems with setting it up and the only tutorial with creating a line chart with Telerik Reporting uses different data source structure (http://www.telerik.com/help/reporting/graphhowtocreatelinechart.html).

    I would really appreciate your help.
    Best regards,
    Natalia
  2. Natalia
    Natalia avatar
    2 posts
    Member since:
    Oct 2014

    Posted 30 Dec 2014 in reply to Natalia Link to this post

    OK. I was able to solve this. Everything worked fine when I set the Category Group to Fields.Date, created a Series Group with no filters, no groupings and no sortings and added three line series with Visits, Ideas and Comments.
Back to Top