This is a migrated thread and some comments may be shown as answers.

Simple read.Action MVC json not working

1 Answer 130 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kim
Top achievements
Rank 1
Kim asked on 06 Nov 2013, 08:01 PM
Not sure why there is no data being pulled into the chart.
I used fiddler to test the Json call and verified that the data is there
However, when running these code through the debugger, the break point never stop at the DrillDownChart_Read ActionResult.


Controller:
[HttpGet]
public ActionResult DrillDownChart_Read()
{
List<IDrillDownChart> myResultList = new List<IDrillDownChart>();
List<int> myIntList = new List<int>();
myIntList.Add(1);
myIntList.Add(2);
myResultList.Add(new DrillDownChartCategoryWithData("x", 20, 25, 1, "webvstf", "Engineering Systems", myIntList));
myResultList.Add(new DrillDownChartCategoryWithData("y", 30, 25, 1, "webvstf", "Engineering Systems", myIntList));

return Json(myResultList, JsonRequestBehavior.AllowGet);
}


View:
@(Html.Kendo().Chart<IDrillDownChart>()
.Name("chart")
.Title("Drill Down Chart")
.Legend(legend => legend
.Position(ChartLegendPosition.Top)
)
.DataSource(dataSource => dataSource
.Read(read => read.Action("DrillDownChart_Read", "ProjectReports"))
)
.SeriesDefaults(seriesDefaults =>
seriesDefaults.Bar().Stack(true)
)
.Series(series => {
series.Bar(d => d.PercentComplete)
.Name("Percent Complete")
.Color("#A7A7A7");
 })
.CategoryAxis(axis => axis
.Categories(model => model.DisplayTitle)
)
 
)

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 08 Nov 2013, 02:01 PM
Hello Kim,

Make sure that you have added all the needed scripts and you are not actually experiencing some of the problems covered in the troubleshooting guide:

http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/troubleshooting

If you still struggle send a small demo project so we can investigate further.

Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Chart
Asked by
Kim
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or