0
votes

I have a Kendo Pie chart reading data from a remote JSON source. The remote JSON endpoint returns:

{
"success": true,
"rows": [
  {
  "monthyear": "November 2017",
  "rrp": "158639.993"
  },
  {
  "monthyear": "October 2017",
  "rrp": "156070.158"
  }
 ]
}

And I've defined the remote datasource in the chart as follows:

$("#chart2").kendoChart({
    dataSource: {
        transport: {
            read: {
                url: "billing.json",
                dataType: "json"
            }
        }
    },
    schema: {
        data: "rows"
    },
    seriesColors: ['#c0392b',  '#2980b9' ],
    seriesDefaults: {
        type: "pie"
    },
    series: [{
        field: "rrp",
        categoryField: "monthyear",
        name:"RRP" 
    }]
});

But I'm getting no chart, and

kendo.all.js:6659 Uncaught TypeError: e.slice is not a function

appears in the console.

Am I referring to the datasource incorrectly?

1

1 Answers

0
votes

You just need to move the schema inside the dataSource property

dataSource: {
    transport: {
        read: {
            url: "billing.json",
            dataType: "json"
        }
    },
    schema: {
       data: "rows"
    },
},

DEMO