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

Issue in multi-series chart when bind from datasource(without ajax)

0 Answers 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Swapnil
Top achievements
Rank 1
Swapnil asked on 12 Oct 2012, 11:16 AM
Hi,

I am generating a bar chart having multiple series. i have generated datasource in controller and passed to view. 
chart is getting displayed with no grouping on series.

Here is view code:

@(Html.Kendo().Chart(Model.VOCBar)    
        .Name("chart6") 
        .Title("Sales") 
        .DataSource(dataSource => dataSource 
            .Group(group => group.Add(model => model.Type)) 
            .Sort(sort => sort.Add(model => model.Date).Ascending()) 
            .Read(read => read.Action("_StockData""Home"))           
        ) 
        .Series(series => 
        { 
            series.Column(model => model.Count) 
                .Name("Type") 
                .GroupNameTemplate("#= group.value #"); 
        }) 
        
.Legend(legend => legend 
            .Position(ChartLegendPosition.Bottom) 
        ) 
        .ValueAxis(axis => axis.Numeric() 
            .Labels(labels => labels 
                .Format("{0}"
                .Skip(2) 
                .Step(2) 
            ) 
        ) 
        .CategoryAxis(axis => axis 
            .Categories(model => model.Date) 
            .Labels(labels => labels.Format("MMM")) 
        )        
        .Tooltip(true)       
     ) 

Please guide me.

--
Swapnil

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Swapnil
Top achievements
Rank 1
Share this question
or