- If you’re overriding the data arrays completely, use
Plotly.restyle
- If you’re extending the exciting data arrays, use
Plotly.extendTraces
Example with Plotly.restyle
:
var data = [{
x: ['VALUE 1'], // in reality I have more values...
y: [20],
type: 'bar'
}];
Plotly.newPlot('PlotlyTest', data);
function adjustValue1(value)
{
Plotly.restyle('PlotlyTest', 'y', [[value]]);
}