Sparkline dinamically data updating

Hi, I don’t understand if possible dinamically update sparkline in “real time” while the page is showed or it is static component and show the only data passed in page loading. If is static, how I can obtain dinamically update?

At the moment, as experiment, I put a cyclical changing of the values of data array bounded to sparkline in page.component.ts, but the line showed by sparkline not change.


The sparkline isn't a static component. If you change the value of the property its Data is set to it will update. Something like this:

Hi, thanks, ok I confirm you with notation:

this.trend= [Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10, Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10,Math.random()*10 ];

Inserted in a setInterval in ngOnInit() of page.component.ts the sparkline is correctly update.

But with this programmatically notation:


the sparkline is not updated, why?

How RADZEN understand that the array is changed and so update sparkline?


Hi, I found this point to manage the programatically updating of sparkline:

  1. Every time you want update the sparkline you must create e new instance of the array with the data. Otherwise sparkline element probably not detect the new values.

  2. If values array contains the same value in every element, sparkline is not showed. To workaround this
    behavoir add a very little random quantity to the value.

Could you check sparkline implementation to improve these points.