Live data charts
Flearz opened this issue · 11 comments
Hello,
I got a server constantly calculating a sine wave, and I would like to represent it using a chart that would be updating in "real-time". I get my values by making constant http requests. Do you think it would be possible with blazorise ? Thanks for you job you're awesome.
Do you mean something like this https://nagix.github.io/chartjs-plugin-streaming/ ?
Yeah exactly, but I don't want to use pure JS in my project :)
For now you can just update dataset manually every n seconds. Although that would look pretty weird every time it updates.
I need to see how to handle third-party plugins for chartjs.
Thank, hope it will be successful.
Hi, is it possible to instead of refreshing the data every X seconds, add data as the api request comes in ?
Yes, you can use AddData
or SetData
methods on the chart.
But when I do, the dots are not linked by a line.
You could also try live-streaming https://blazorise.com/docs/extensions/chart/#third-party-plugins
It looks to me like chart options are not properly configured. Look at these
chartjs/Chart.js#800
https://www.chartjs.org/docs/latest/charts/line.html