Tag: 情节

如何使用plot.ly将新数据添加到现有graphics

我想添加新的数据到现有的graphics。 这意味着我想将现有的渲染数据点与新的数据点合并,以将旧的和新的数据点渲染在一起。 我正在尝试使用Plotly.newPlot来渲染这样的新数据: const TESTER = document.getDocumentById('tester'); const dataPoints = { x: [1, 2, 3], y: [1, 2, 3], text: ['1 text', '2 text', '3 text '], size: [1, 2, 3], color: [1, 2, 3] }; const layout = { margin: { t: 0 }, hovermode: 'closest' }; const dataToRender = { x: [dataPoints.x], y: […]