Dynamic Data Loading

8 posts, 0 answers
  1. David
    David avatar
    4 posts
    Member since:
    May 2015

    Posted 22 May 2015 Link to this post

    I am trying to chart data in real-time from an external source -- in this case, a Bluetooth device -- that is streaming values to me.

    Is this possible? I can't seem to figure out how to do this. I'd like to add a new datapoint to the end of a datasource, and remove the first datapoint, etc.

     

     

  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 22 May 2015 Link to this post

    Hi David,

    Assuming that you have the data flowing from the bluetooth device and change it at a given interval, the Telerik Chart can cover your scenario. For more information, please refer to the Chart >> Live Data example of the Demo app that ships with the Telerik UI for iOS suite. You can also check the Building a Seismograph App with CoreMotion, Swift and Telerik UI for iOS blog article which covers a similar scenario where the data is taken from the device accelerometer.

    I hope this helps.

    Regards,
    Nikolay
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. David
    David avatar
    4 posts
    Member since:
    May 2015

    Posted 22 May 2015 in reply to Nikolay Link to this post

    While that example does show live data loading, the requirement to call removeAllData() and then re-build the chart is problematic when the data comes in slowly, as over Bluetooth. The device only sends updates every second or so, which means that the re-draw is awful looking. because it is re-drawing the entire chart, rather slowly, every few seconds. Not a smooth look at all. 

     

     

  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 25 May 2015 Link to this post

    Hi David,

    Currently the only option to update TKChart in this scenario is by calling removeAllData method. However, this should not cause issues when your data is updated every few seconds. Could you, please prepare a sample application. We will analyse it in detail and we will try to find a proper solution.

    There is an issue logged in our feedback portal related with this scenario. Use the following link to track its status and vote/comment on it.

    Looking forward to your reply.

    Regards,
    Jack
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. David
    David avatar
    4 posts
    Member since:
    May 2015

    Posted 26 May 2015 in reply to Jack Link to this post

    Crude app that shows the problem. Data is simply inserted after a timer fires every 2.5 seconds ... 

     

    You can download the Xcode project at https://davidgs.com/TelerikTest.zip

     Best regards,

    dg

  7. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 27 May 2015 Link to this post

    Hi David,

    I am not able to open the link. Could you, please upload the file again? Looking forward to your reply.

    Regards,
    Jack
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. David
    David avatar
    4 posts
    Member since:
    May 2015

    Posted 27 May 2015 in reply to Jack Link to this post

    Sorry, I have fixed the link ... 
  9. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 01 Jun 2015 Link to this post

    Hello David,

    The link works now. I checked your code. The redraw issue is caused by the animations in TKChart. You can improve chart appearance in this scenario by disabling animations:
    myChart.allowAnimations = false

    As I said, the issue is logged in our feedback portal and we will consider implementing partial updates for TKChart in one of our upcoming releases.

    Should you have other questions, do not hesitate to ask.

    Regards,
    Jack
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner