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

Cant seem to send data with chart refresh

1 Answer 72 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 03 Jun 2014, 03:31 AM
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

$(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





1 Answer, 1 is accepted

Sort by
0
Alan Mosley
Top achievements
Rank 1
answered on 03 Jun 2014, 04:19 PM
Please ignore, i had so many things wrong, got it working now
Tags
Chart
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Alan Mosley
Top achievements
Rank 1
Share this question
or