How to generate dataSource for Chart

2 posts, 0 answers
  1. Leonid
    Leonid avatar
    12 posts
    Member since:
    Oct 2012

    Posted 25 Sep 2012 Link to this post

    I do not know as to copy following code from Kendo UI Fluent to write in JavaScript

    Code Kendo UI Fluent

    @(Html.Kendo().Chart() .Name("Chart") 
               .DataSource(ds => ds.Read(read => read.Action("ActionName", "ControllerName")
               .Data("filterFunction")))

    Code JavaScript
    jQuery(document).ready(function($)
    {
    $("#chart").kendoChart({
       dataSource: {
         transport: {
             read: "ControllerName/ActionName",
          parameterMap: filterFunction
    }
    },
  2. David
    David avatar
    2 posts
    Member since:
    Sep 2012

    Posted 28 Sep 2012 Link to this post


    Not work!
    Where here an error?
    Does not address at all to the controller

    ds = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: '@Url.Action("Action", "Controller")',
                            dataType: "json",
                            data:{
                                id: function() {
                                    return $("#field").val();
                                }
                               
                               
                            }        
                        }
                    }
                });
Back to Top