use websocket as chart datasource and refresh as data changes

4 posts, 0 answers
  1. Vedad
    Vedad avatar
    54 posts
    Member since:
    Jun 2018

    Posted 29 Aug Link to this post

    Hi, 

    I managed to combine something and have chart bound to same websocket ds as grid in your demo. 

    Read method gets data and draws pie chart, but when I update data via grid, nothing happens.

    After some investigation it seems, pushUpdate in transport causes error causing chart not to update.

    on this part: 

      //Check what the push type is and invoke the corresponding callback.
                                    if (result.type == "push-update") {
                                        options.pushUpdate(result);        
                                  } 

    This is error I get in demo:

    kendo.all.js:7092 Uncaught TypeError: Cannot read property 'call' of undefined
        at Object.<anonymous> (VM30647 kendo.all.min.js:28)
        at Function.Deferred (VM30646 jquery.min.js:2)
        at init._promise (VM30647 kendo.all.min.js:28)
        at init._send (VM30647 kendo.all.min.js:28)
        at init.sync (VM30647 kendo.all.min.js:28)
        at init._change (VM30647 kendo.all.min.js:28)
        at init.d (VM30646 jquery.min.js:2)
        at init.trigger (VM30647 kendo.all.min.js:25)
        at o.<anonymous> (VM30647 kendo.all.min.js:27)
        at o.trigger (VM30647 kendo.all.min.js:25)

     

    Is there any different approach I can/should take so I can have real time updates on the chart?

    Thank you and regards,

    Vedad

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2342 posts

    Posted 02 Sep Link to this post

    Hi Vedad,

     

    Based on the available information it would be hard to pinpoint what is causing the behavior. Would you send us a dojo sample or a runnable project where the issue is replicated? This will enable us to examine the behavior locally and look for its cause.

     

    Regards,
    Viktor Tachev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Vedad
    Vedad avatar
    54 posts
    Member since:
    Jun 2018

    Posted 03 Sep in reply to Viktor Tachev Link to this post

    Hi Viktor,

    sorry for lack of information.

    Unfortunately, I don't have code anymore as I was playing with websocket grid dojo and added chart above. I used same datasource for both, and I was getting this error.

    Eventually I went with slightly different approach and closed this Dojo. 

    I will try to reproduce it again and save the Dojo.

    Is there any recommended approach for Charts when using websocket as datasource?

    Thank you and regards,

    Vedad

  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2342 posts

    Posted 05 Sep Link to this post

    Hello Vedad,

     

    I am glad to hear that you have found an approach that works for your scenario.

    With that said, the Chart widget expects the data to be formatted as expected by the specific series that would be shown. As long as the data is returned in the correct format the Chart would display the results as expected.

     

    Regards,
    Viktor Tachev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top