Plotly update data

后端 未结 4 1192
一个人的身影
一个人的身影 2020-12-10 01:50

Okay so i have the following code:

    var element = document.getElementById(scope.changeid);

function getData(division,redraw) {
    var employeeData = [];         


        
4条回答
  •  自闭症患者
    2020-12-10 02:02

    According to a Plotly community moderator (see the first answer here), Plotly.restyle is faster than Plotly.redraw and Plotly.newPlot.

    Example taken from the link:

    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]]);
    }
    

提交回复
热议问题