Cannot create Kendo pie chart for ASP.NET mvc

111 Views Asked by At

This is the first time I am using Kendo pie chart.... Dont know whats wrong.

View Code:

 @(Html.Kendo().Chart<PharmaIntel_New.Models.PipeLinePieChart>()
 .Name("PipeLinePipeChart") 
 .Legend(legend => legend
     .Visible(false))
 .DataSource(ds =>
 {
      ds.Read(read => read.Action("DrawPieChart", "PipeLineScreen").Data("PieChartData"));             
 })
 .Series(series => series
     .Pie(model => model.DrugVendorName, model => model.NetPresentValue, model => model.Color)
     .Padding(0))
     .Tooltip(tooltip => tooltip
     .Visible(true)
     .Shared(true)
     //.Format("{0:N0}")
     //.Template("#= category # - #= kendo.format('{0:P}', percentage)#")))

Controller Code:

public ActionResult DrawPieChart([DataSourceRequest] DataSourceRequest request, string pipeName, string pipeLineId)
{

    List<PipeLinePieChart> pipeLinePieChartList = new List<PipeLinePieChart>();

    PipeLinePieChart pipeLinePieChartObj;
    pipeLinePieChartObj = new PipeLinePieChart();


   pipeLinePieChartObj.DrugVendorName = drugVendorItem;
   pipeLinePieChartObj.Color = "#ccc";
   pipeLinePieChartObj.NetPresentValue = pipeLineSummaryItem.NetPresentValue;

   pipeLinePieChartList.Add(pipeLinePieChartObj);

   return Json(pipeLinePieChartList, JsonRequestBehavior.AllowGet);​
}​
0

There are 0 best solutions below