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

2 posts, 0 answers
  1. Andy
    Andy avatar
    2 posts
    Member since:
    Oct 2015

    Posted 26 Oct 2015 Link to this post

    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
  2. Andy
    Andy avatar
    2 posts
    Member since:
    Oct 2015

    Posted 26 Oct 2015 in reply to Andy Link to this post

    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!

Back to Top