0

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);​
}​
Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148
Suk
  • 53
  • 9
  • Thats the problem, it doesnot show any error message. The pie chart is not painted on the screen. – Suk Jun 24 '15 at 12:07
  • So there's nothing in the browser console? If you debug your controller method, do you see anything in `pipeLinePieChartList`? – Mathew Thompson Jun 24 '15 at 12:12
  • What is "PieChartData", where it is defined. Try removing .Data("PieChartData"). – SBirthare Jun 24 '15 at 12:17
  • PieChartData is used to pass the PipeName and PipeLineId from the view using javascript. and shows no error in browser console. – Suk Jun 24 '15 at 12:30
  • I could run your code and see the pie chart. Significant change I did was removing .Data("PieChartData"). The variable are not used on server side anyway. – SBirthare Jun 24 '15 at 12:38
  • I need to pass the .Data("PieChartData") part. There is a kendo grid and on row click I have to create its pie chart, so need to pass that .Data() part. My service side code gives me the correct data but I think I might be wrong in view part. – Suk Jun 24 '15 at 13:12

0 Answers0