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

Binding to multiple series

1 Answer 127 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Espen Moen Kvelland
Top achievements
Rank 1
Espen Moen Kvelland asked on 15 Aug 2014, 08:29 AM
I havet his Json 

[{"NumberOfDays":"41","Month":"1","year":"2013"},{"NumberOfDays":"8","Month":"2","year":"2013"},{"NumberOfDays":"14","Month":"3","year":"2013"},{"NumberOfDays":"6","Month":"4","year":"2013"},{"NumberOfDays":"-10","Month":"5","year":"2013"},{"NumberOfDays":"15","Month":"6","year":"2013"},{"NumberOfDays":"6","Month":"7","year":"2013"},{"NumberOfDays":"9","Month":"8","year":"2013"},{"NumberOfDays":"17","Month":"9","year":"2013"},{"NumberOfDays":"19","Month":"10","year":"2013"},{"NumberOfDays":"6","Month":"11","year":"2013"},{"NumberOfDays":"16","Month":"12","year":"2013"},{"NumberOfDays":"0","Month":"3","year":"2014"},{"NumberOfDays":"6","Month":"4","year":"2014"},{"NumberOfDays":"10","Month":"5","year":"2014"},{"NumberOfDays":"9","Month":"6","year":"2014"},{"NumberOfDays":"0","Month":"7","year":"2014"},{"NumberOfDays":"0","Month":"1","year":"2014"},{"NumberOfDays":"0","Month":"2","year":"2014"},{"NumberOfDays":"0","Month":"8","year":"2014"},{"NumberOfDays":"0","Month":"9","year":"2014"},{"NumberOfDays":"0","Month":"10","year":"2014"},{"NumberOfDays":"0","Month":"11","year":"2014"},{"NumberOfDays":"0","Month":"12","year":"2014"}]

Then I create this chart

 @(Html.Kendo().Chart<AceoHR.Models.simpleClass.simpleChartClass>()
    .Name("chart")
    .Title("Egenmeldingsdager")
    .DataSource(ds => ds.Read(read =>
        read.Action("GetStatsSickDaysByMonth", "SickDays"))
        .Group(g => g.Add(v => v.year))
        )
            .Series(series =>
            {                                                           
                series.Line(value => value.NumberOfDays, category => category.Month).Name("#:group.month#").Labels(labels => labels.Visible(false).Color("Red")).Color("Blue");
                //series.Area(model => model.NumberOfDays, ).CategoryField("Month");                
            })
               .CategoryAxis(axis => axis
                .Categories(model => model.NumberOfDays)
                .Labels(labels => labels.Rotation(-90))
                .Justify()
                .Crosshair(c => c.Visible(true))
            )
            .ValueAxis(axis => axis.Numeric()
                .Labels(labels => labels.Format("{0:N0}"))
            )
            .Tooltip(tooltip => tooltip
                .Visible(true)
                .Shared(true)
                .Format("{0:N0}")
            )
                )


The problem is that I'm not able to make this look as it should, check out the attach screenshot. The x axis should show the 12 months, the values on the graphs should show the NumberOfDays

Any advice

1 Answer, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 15 Aug 2014, 12:37 PM
Hello Espen Moen Kvelland,

I am not sure that I can understand you. Could you please give me more information about your current scenario?

Regards,
Hristo Germanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Espen Moen Kvelland
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Share this question
or