Kendo Stock Chart with Dynamically Updated Data

8 posts, 1 answers
  1. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 23 Mar Link to this post

    Hello,

    Thank you for the example on Kendo-Stock chart using AngularJS.

    I want to create a kendo stock chart using AngularJS which should be based upon dynamically updated data.But I am able to do with a fixed period of time only.
    Can you suggest me the solution with an example?

     

    Regards,
    Adyasha

  2. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 24 Mar in reply to developer Link to this post

    I'm expecting the functionality as given in this fiddler.

  3. Kendo UI is VS 2017 Ready
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 25 Mar Link to this post

    Hi,

    The StockChart will respond to changes in the underlying data source.

    See this dojo demo for an example. I had to manually update the navigator range.
    Will investigate if this can be fixed.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 27 Mar in reply to T. Tsonev Link to this post

    Hello Tsonev,

    I'm not able to access the demo link. Can you paste the code in comment please.

    I believe the dojo site is down.

  6. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 28 Mar in reply to T. Tsonev Link to this post

    Hello Tsonev,

    Thanks for the example. But I don't want to render the chart every-time. It should append the new data into the chart series. I'm expecting the smooth render as per the example from fiddler.

    In my app, I'm going to get the data for every few seconds or minutes. so I should render the chart with new data with smooth render.

    Is't possible to render like that in kendo chart.

    Thanks.

  7. EZ
    EZ avatar
    60 posts
    Member since:
    May 2015

    Posted 28 Mar in reply to developer Link to this post

    You can turn off transitions in the chart:

    Updated DOJO

  8. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 29 Mar in reply to EZ Link to this post

    Hi EZ,

    Thanks for reply. As I'm using series to bind data to kendo chart instead of data source add,remove,at methods are not working,here is the DOJO Example i tried with simple JavaScript functions,its not working.

    Is there any other solution for dynamically updating data with series data binding.

    Thanks
  9. Answer
    EZ
    EZ avatar
    60 posts
    Member since:
    May 2015

    Posted 29 Mar in reply to developer Link to this post

    When updating series instead of a dataSource, you need to explicitly tell the chart to refresh

    var chart = $("#chart").data("kendoChart");
    var ds = chart.options.series;
    kendoConsole.log("Before : "+ JSON.stringify(ds[0].data));
    var index = ds[0].data.indexOf(ds[0].data[0]);
    ds[0].data.splice(index, 1);        
    ds[0].data.push(Math.floor(Math.random()* 12));
    kendoConsole.log("After : " + JSON.stringify(ds[0].data));
                  
    chart.refresh();

    Updated DOJO

Back to Top
Kendo UI is VS 2017 Ready