score:0

To get realtime data in a d3 chart, you will need to either implement a polling script on the JSON URL or utilize websockets for real-time communication.

A polling script would query the JSON URL every X seconds, and execute the d3 add / update / delete pattern as appropriate.

With websockets, you can maintain a persistant connection to the API and the server sends messages to connected clients when the data is updated. This again would call the d3 add / update / delete pattern.

SO example with web sockets:

https://stackoverflow.com/a/13694422/2490989

Polling example:

http://www.devixgroup.com/blog/2015/01/using-ajax-polling-with-d3-js-eventdrops-project/


Related Query

More Query from same tag