This is a migrated thread and some comments may be shown as answers.

Sparkline refreshing data

2 Answers 111 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 27 Jun 2013, 05:11 AM
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.
http://jsbin.com/atezoj/36/edit

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

Thanks,

Rob

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 28 Jun 2013, 12:11 PM
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

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Robert
Top achievements
Rank 1
answered on 01 Jul 2013, 12:34 PM
Thanks Iliana,

That's perfect!
Tags
Sparkline
Asked by
Robert
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Robert
Top achievements
Rank 1
Share this question
or