I have a kendo chart where in i have data from jan to jun in which it has multiple locations. For example Jan with A,B,Total as location and Feb with A,B,Total. Now i have to show the chart with bar with location and Line chart for Total. For showing the bar chart we have to do group by location and because of this for line also it is showing for all locations. Could you please help me how to resolve this.I have to draw the line chart without location it should be like for each month one total.
@(Html.Kendo().Chart(Model.CertifiedIronProductionReports)
@(Html.Kendo().Chart(Model.CertifiedIronProductionReports)
.Name("CertifiedIronProduced")
.Legend(legend => legend
.Visible(true)
.Position(ChartLegendPosition.Top)
)
.ChartArea(chartArea => chartArea
.Background("transparent")
)
.DataSource(datasource => datasource
.Group(group => group.Add(model => model.Location))
.Sort(sort => sort.Add(model => model.Month))
)
.Series(series =>
{
series.Column(Model.CertifiedIronProductionReports).CategoryField("Month").Field("IronCount");
})
.Series(series =>
{
series.Line(Model.CertifiedIronProductionReports).CategoryField("Month").Field("Total").Axis("TotalAxis");
})
.CategoryAxis(axis => axis
.Categories(categories => categories.Month)
.AxisCrossingValue(0, 20)
)
.ValueAxis(axis => axis
.Numeric()
.Line(line => line.Visible(false))
.MajorGridLines(lines => lines.Visible(true))
)
.ValueAxis(axis => axis
.Numeric("TotalAxis")
.Line(line => line.Visible(false))
.MajorGridLines(lines => lines.Visible(true))
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Template("#= series.name #: #= value #")
)
)
[{"lstTotal":null,"Location":"Tomball","IronCount":383,"Month":"Jan-2015","Total":0},{"lstTotal":null,"Location":"Average","IronCount":413,"Month":"Jan-2015","Total":0},{"lstTotal":null,"Location":"Grand Junction","IronCount":443,"Month":"Jan-2015","Total":0},{"lstTotal":null,"Location":"Total","IronCount":0,"Month":"Jan-2015","Total":826},{"lstTotal":null,"Location":"Tomball","IronCount":180,"Month":"Feb-2015","Total":0},{"lstTotal":null,"Location":"Average","IronCount":280,"Month":"Feb-2015","Total":0},{"lstTotal":null,"Location":"Grand Junction","IronCount":381,"Month":"Feb-2015","Total":0},{"lstTotal":null,"Location":"Total","IronCount":0,"Month":"Feb-2015","Total":561}]