"TypeError: a[0] is undefined" when binding to remote JSON data

2 posts, 0 answers
  1. Chris
    Chris avatar
    1 posts
    Member since:
    Aug 2010

    Posted 22 Jul 2013 Link to this post

    Trying to populate a dataviz chart with remote data but no data is plotted and "TypeError: a[0] is undefined" is thrown by kendo.dataviz.min.js.

    chart is setup as follows:

    function createChart(Description) {
                var chartds = new kendo.data.DataSource({
                    transport: {
                        read: {
                            type: "POST",
                            url: "../AJAX/service.asmx/GetMetricTrend",
                            dataType: "json",
                            contentType: "application/json"
                        parameterMap: function (data, operation) {
                            if (operation != "read") {
                                // web service method parameters need to be send as JSON. The Create, Update and Destroy methods have a "products" parameter.
                                //return JSON.stringify(data);

                            else {
                                // web services need default values for every parameter
                                data = $.extend({ intMetricID: 17}, data);

                                return JSON.stringify(data);
                    schema: {
                        data: "d"

                    dataSource: chartds,
                    title: {
                        text: Description + " Weekly Trend"  
                    legend: {
                        position: "bottom"
                    seriesDefaults: {
                        type: "line"
                        field: "Value",
                        name: "Actual Value"
                    categoryAxis: {
                        field: "Week",
                        labels: {
                            rotation: 0
                    valueAxis: {
                        labels: {
                            format: "N0"
                        majorUnit: 10
                    tooltip: {
                        visible: true,
                        format: "N0"

    JSON response:


    following .js files are included:


  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 23 Jul 2013 Link to this post

    Hi Chris,

    I have already answered to the same question in your other thread, however I am pasting my reply here too:

    The provided Chart's configuration looks OK, however I checked the details in your other thread and believe the issue is caused by kendo.dataviz.min.js is included before kendo.web.min.js (while the order should be opposite). Keep in mind when using widgets from different Kendo UI suites it is recommended using the combined kendo.all.min.js file (which contains a minified version of all scripts). Also the used Kendo UI version (v2013.1.514) requires jQuery 1.9.1 while you are using 1.8.2. More detailed information  on this subject can be found in the corresponding documentation.

    Iliana Nikolova
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top