Sparkline refreshing data

3 posts, 1 answers
  1. Answer
    Robert avatar
    17 posts
    Member since:
    Mar 2011

    Posted 27 Jun 2013 Link to this post

    Hi there,

    After successfully creating a sparkline with localdata, i am trying to then change the data in the spark line and refresh it. 

    I have tried setting the data directly and then using refresh as well as using the setDataSource method but have had no luck so far.

    I have created an example in the link below which demonstrates the issue. 
    So when you click the "refresh new data"  the data in the sparkline does not change.

    Is it possible to do this or do i need to dispose of the sparkline and create a new one with new data?



  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 28 Jun 2013 Link to this post

    Hi Rob,

    Thank you for the runnable example.  

    Generally speaking, when bound to a dataSource (like in this online demo) and such dataSource is changed the Sparkline will automatically refresh. In your example the data is passed as an array - hence in order to achieve the desired result you should pass the new data via the options and refresh the Sparkline. For your convenience here is the updated jsFiddle example

    Iliana Nikolova
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Robert
    Robert avatar
    17 posts
    Member since:
    Mar 2011

    Posted 01 Jul 2013 Link to this post

    Thanks Iliana,

    That's perfect!
Back to Top