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

Kendo Chart e.slice is not a function with remote data

1 Answer 584 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 26 Oct 2015, 03:08 PM
Hi All,
I'm starting to use Kendo's Chart functions for the first time. Using Local Data I can get a chart working fine (http://dojo.telerik.com/eYIrO). When I uncomment out the "transport" section of that Dojo to use Remote Data I get an error in Line 11 of kendo.all.min.js: Uncaught TypeError: e.slice is not a function

The data received by the URL is the exact same as the varDataSource variable (I use PHP json_encode array which I use with Google Charts):
{"data":[{"varRTT":"12","varIPAddress":"10.6.120.240","varPingDate":"1"},{"varRTT":"13","varIPAddress":"10.6.120.240","varPingDate":"2"},{"varRTT":"19","varIPAddress":"10.6.120.240","varPingDate":"3"},{"varRTT":"2","varIPAddress":"10.10.115.252","varPingDate":"4"},{"varRTT":"2","varIPAddress":"10.10.115.252","varPingDate":"5"}]}

I've seen some issues in the forums with remote data and serverGrouping so I disabled that. I also tried to use Schema.Model and define my fields but it didn't work or I didn't do it correctly.

Any help would be appreciated.
Thanks!
Andy

1 Answer, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 26 Oct 2015, 07:31 PM

I was able to fix this after playing around a bit.

The issue was myself not being familiar enough with JS/JSON/Kendo. Apparently that {"data":} portion at the start of my PHP JSON is important. When I removed that part from my PHP (echo "{\"data\":" .json_encode($arr). "}";) it worked fine. Although my Kendo MultiSelects which use JSON started to fail. I reverted the PHP to be the original (above) and added this to my Kendo Chart datasource:

            schema: {
              data: "data"
            },

 

After that it works fine!

Tags
Charts
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Share this question
or