Updating candlestick data point using restyle in Plotly.js
问题 I am using a WebSocket connection to update a candlestick chart with live data. Creating the initial candlestick chart is relatively easy: var candleDiv = document.getElementById('candle-chart'); var data = { x: x, //Each of these is a single dimension array of the same length open: open, close: close, high: high, low: low, type: 'candlestick', }; var layout = { datarevision: candleCount, dragmode: 'zoom', showlegend: false, xaxis: { type: 'date', range: [x[x.length - 26], x[x.length - 1]], /