I am trying to refresh a chart using ajax, but cant seem to send data. Where am I going wrong, I have tried many things to pass data, but all have failed
I am trying send dates
My chart
I am trying send dates
$(document).ready(
function
() {
var
pieUrl =
"@pieUrl"
;
var
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url: pieUrl,
dataType:
"json"
}
}
});
dataSource.read({
"FromDate"
: kendo.toString($(
"#FromDate"
).data(
"kendoDatePicker"
).value(),
"dd/MM/yyyy"
),
"ToDate"
: kendo.toString($(
"#ToDate"
).data(
"kendoDatePicker"
).value(),
"dd/MM/yyyy"
) })
var
chart = $(
"#EnrolmentsValue"
).data(
"kendoChart"
);
chart.setDataSource(dataSource);
chart.redraw();
chart.refresh();
})
My chart
@code
Dim EnrolmentsValue As Kendo.Mvc.UI.Chart(Of BO.Models.Statistics.KeyValue) = _
Html.Kendo().Chart(Of BO.Models.Statistics.KeyValue).Name(
"EnrolmentsValue"
).Title(Sub(title)
title.Text(
"Share of Internet Population Growth, 2007i - 2012"
).Position(ChartTitlePosition.Bottom)
End Sub).
Legend(Sub(legend)
legend.Visible(False)
End Sub).
Series(Sub(series)
series.Pie(Nothing).Labels(Sub(labels) labels.Template(
"#= Key #: #= Value#%"
).
Background(
"transparent"
).Visible(True)).StartAngle(150)
End Sub).Tooltip(Function(tooltip) tooltip.Visible(True).Format(
"{0}%"
)).AutoBind(True).
DataSource(Sub(ds)
ds.Read(Function(read) read.Action(
"getsalesbyfranchisee"
,
"statistics"
, New With {.area = String.Empty}))
End Sub)
EnrolmentsValue.Render()
Dim pieUrl As String = Url.Action(
"getsalesbyfranchisee"
,
"statistics"
, New With {.area = String.Empty})
end code