This question is locked. New answers and comments are not allowed.
Hi guys,
I'm trying the new Chart component, using the online help.
I would like to use AjaxBinding to display the data.
The view code is the same as the help.
[code]
<%= Html.Telerik().Chart<SalesData>()
.Name("chartAjax")
.Title("Representative Sales vs. Total Sales")
.Series(series => {
series.Bar("RepSales").Name("Representative Sales");
series.Bar(s => s.TotalSales).Name("Total Sales");
})
.CategoryAxis(axis => axis
.Categories(s => s.DateString)
)
.DataBinding(dataBinding => dataBinding
// Ajax binding
.Ajax()
// The action method which will return JSON
.Select("ChartBinding", "Home")
)
%>
[/code]
In my controller I have
[code]
public ActionResult ChartBinding()
{
var vd = new SalesData();
vd.RepSales = new int[] { 2015, 6003, 6881 };
vd.TotalSales = new int[] { 15458, 26598, 27623 };
vd.DateString = new string[] { "Aug 2010", "Sept 2010", "Oct 2010" };
return Json(vd);
}
[/code]
But nothing appears... I put a breakpoint on my controller, it goes successfully. Any idea ??
Thanks !!
I'm trying the new Chart component, using the online help.
I would like to use AjaxBinding to display the data.
The view code is the same as the help.
[code]
<%= Html.Telerik().Chart<SalesData>()
.Name("chartAjax")
.Title("Representative Sales vs. Total Sales")
.Series(series => {
series.Bar("RepSales").Name("Representative Sales");
series.Bar(s => s.TotalSales).Name("Total Sales");
})
.CategoryAxis(axis => axis
.Categories(s => s.DateString)
)
.DataBinding(dataBinding => dataBinding
// Ajax binding
.Ajax()
// The action method which will return JSON
.Select("ChartBinding", "Home")
)
%>
[/code]
In my controller I have
[code]
public ActionResult ChartBinding()
{
var vd = new SalesData();
vd.RepSales = new int[] { 2015, 6003, 6881 };
vd.TotalSales = new int[] { 15458, 26598, 27623 };
vd.DateString = new string[] { "Aug 2010", "Sept 2010", "Oct 2010" };
return Json(vd);
}
[/code]
But nothing appears... I put a breakpoint on my controller, it goes successfully. Any idea ??
Thanks !!