Live data via APIs?
Would be great to illustrate how the data variable for any chart can be updated from another source vs. hard coding it, as shown in the examples - for example, can I use this with a text file with the values? or even pull data directly from an API source like google analytics? thx
+1 this would be very useful, as I want to use this on a wallboard which i want to create the chart once, and just refresh the data
Thanks for this, in the coming couple of weeks I'm planning to add some utility methods on the charts that are returned, so after creating a chart and assigning it to a variable, you could call a method on that variable to add new data, or clear the chart etc. Stay tuned!
What you could do for now is recreate your chart each time you update your data via ajax or sockets or whatever.
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
@nnnick The simplest solution i've found for now to live update is to use jQuery's replaceWith().
See here for an example: https://gist.github.com/skhisma/5689383
That would work right now @skhisma
Alternatively, you could do something like this and keep hold of your chart object, then call Doughnut each time you want to load new data in.
var chartConstruct = new Chart(ctx);
chartConstruct.Doughnut(data,options);
//A little later on when you've got some new data...
chartConstruct.Doughnut(newData,options)
Chart.js won't have methods for getting new data - that'll be up to your application, but there will be a better API for this soon.
will there be an update for this feature soon?
:+1:
There will be an update for this. I don't have an ETA just yet, but it'll have a whole load of new fancy stuff!
awesome! +100
any chance this will be done for the challenge post contest?