3 ms·
Most d3 examples will have a "draw" function that you call every time the data is updated. You basically bind your dataset to SVG elements, then D3.js will diff
by wattenberger 7y ago
Most d3 examples will have a "draw" function that you call every time the data is updated. You basically bind your dataset to SVG elements, then D3.js will diff the new data with that bound data and decide what to update. A good intro to the concept:
https://bost.ocks.org/mike/join/ https://bost.ocks.org/mike/join/
I personally usually am working in a React app, so I would use that to render (and update) the chart.
However, that's a pretty complicated example to start with! You might be better off using one of the higher-level libraries, like this one:
https://apexcharts.com/javascript-chart-demos/candlestick-charts/basic/ https://apexcharts.com/javascript-chart-demos/candlestick-ch...
There are a ton to choose from (just google `js candlestick chart`), and they can be pretty customizeable.