Cant seem to send data with chart refresh

2 posts, 0 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 02 Jun 2014 Link to this post

    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





  2. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 03 Jun 2014 in reply to Alan Mosley Link to this post

    Please ignore, i had so many things wrong, got it working now
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top