Sachin Singh

Sachin Singh

  • 7
  • 55.8k
  • 81.7k

how to show to y values in MVC chart helper.

Dec 5 2020 7:39 AM
MVC also provides a chart helper , and MS documentation shows all types of chart images, but i am unable to use two y values , i tried a lot and now i think there is no way or it just doesn't support column chart with multiple y values.
what i want is , to show each department's performance each month like shown in below figure
 
 
suppose x axis (1,2,3,4,5,6,7) are department , y axis (performance in jan,feb and march)
 i have tried below code, there is no way to use two y values ,
if i add two series then it generates multiple x's.
  1. @{  
  2.     var chart = new Chart(width500height500, theme: ChartTheme.Yellow)  
  3.    .AddTitle("......")  
  4.    .AddSeries("Default", chartType: "column",  
  5.         xValue: Model, xField: "Department",  
  6.         yValues: Model, yFields: "Month" // no option to include multiple y  
  7.         
  8.           
  9.         )  
  10.            
  11.     .Write();