MVC Chart Combination

how can i build a chart with bars and line from a single json that came with this content
Total, Month, Year
50,1,2018
40,2,2018
78,2,2017
57,3,2017



1 Reply

BP Baby Palanidurai Syncfusion Team March 7, 2018 09:21 AM UTC

Hi Gian carlo, 

Thanks for using syncfusion products. 

We have analyzed your query. As for your requirement, we have prepared a sample for bar and line chart combination. Bar charts cannot be combined with other cartesian type charts. To achieve bar and line charts, you can use series type as column and set isTransposed property as true. Kindly find the code snippet below to achieve this requirement. 


  @Html.EJS().Chart("container").Series(series => 
       { 
           series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Column).XName("year").YName("total").DataSource(ViewBag.dataSource).Add(); 
           series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Line).XName("year").YName("total").DataSource(ViewBag.dataSource).Add(); 
 
 
       }).IsTransposed(true).Render() 

Screenshot: 
 
Sample for reference can be find from below link, 

Kindly revert us, if you have any concerns. 

Thanks, 
Baby. 


Loader.
Up arrow icon