Place the modeBar at top center using plotly.js

2019-06-23 18:12发布

问题:

I am using plotly.js to plot graph in my web app. The modeBar is placed at top right corner by default. Is there any way I can place it at the top center?

回答1:

This should work:

.js-plotly-plot .plotly .modebar {
    left: 50%;
    transform: translateX(-50%);
}


回答2:

.js-plotly-plot .plotly .modebar{left: 40%}