|
1 | 1 | ---
|
2 |
| -name: Remove ModeBar Button |
3 |
| -plot_url: https://codepen.io/plotly/embed/OQyEaP/?height=450&theme-id=15263&default-tab=result |
| 2 | +name: Remove ModeBar Buttons |
4 | 3 | language: plotly_js
|
5 | 4 | suite: configuration
|
6 | 5 | order: 5.5
|
7 | 6 | sitemap: false
|
8 | 7 | arrangement: horizontal
|
9 | 8 | markdown_content: |
|
10 |
| - To delete buttons from the modebar, put buttons name in an array of string and pass it to 'modeBarButtonsToRemove' in config. Here is all the buttons' names: |
| 9 | + To delete buttons from the modebar, pass an array of strings containing the names of the buttons you want to remove to the `modeBarButtonsToRemove` attribute in the figure's configuration object. Note that different chart types have different default modebars. The following is a list of all the modebar buttons and the chart types they are associated with: |
11 | 10 | <ul>
|
12 |
| - <li>- 2D: zoom2d, pan2d, select2d, lasso2d, zoomIn2d, zoomOut2d, autoScale2d, resetScale2d</li> |
13 |
| - <li>- 3D: zoom3d, pan3d, orbitRotation, tableRotation, handleDrag3d, resetCameraDefault3d, resetCameraLastSave3d, hoverClosest3d</li> |
14 |
| - <li>- Cartesian: hoverClosestCartesian, hoverCompareCartesian</li> |
15 |
| - <li>- Geo: zoomInGeo, zoomOutGeo, resetGeo, hoverClosestGeo</li> |
16 |
| - <li>- Other: hoverClosestGl2d, hoverClosestPie, toggleHover, resetViews, "toImage", "sendDataToCloud", "toggleSpikelines", “resetViewMapbox"</li> |
| 11 | + <li>- 2D: `zoom2d`, `pan2d`, `select2d`, `lasso2d`, `zoomIn2d`, `zoomOut2d`, `autoScale2d`, `resetScale2d`</li> |
| 12 | + <li>- 3D: `zoom3d, `pan3d`, `orbitRotation`, `tableRotation`, `handleDrag3d`, resetCameraDefault3d, `resetCameraLastSave3d`, `hoverClosest3d`</li> |
| 13 | + <li>- Cartesian: `hoverClosestCartesian, `hoverCompareCartesian`</li> |
| 14 | + <li>- Geo: `zoomInGeo, `zoomOutGeo`, `resetGeo`, `hoverClosestGeo`</li> |
| 15 | + <li>- Other: `hoverClosestGl2d`, `hoverClosestPie`, `toggleHover`, `resetViews`, toImage, `sendDataToCloud`, `toggleSpikelines`, `resetViewMapbox`</li> |
17 | 16 | </ul>
|
18 | 17 | ---
|
19 | 18 | var data = {
|
20 | 19 | x:['trees', 'flowers', 'hedges'],
|
21 | 20 | y: [90, 130, 40],
|
22 |
| - type: 'bar'}; |
| 21 | + type: 'bar'} |
23 | 22 |
|
24 | 23 | var layout = {
|
25 | 24 | title: 'Remove Modebar Buttons',
|
26 |
| - showlegend: false}; |
| 25 | + showlegend: false} |
27 | 26 |
|
28 |
| -Plotly.newPlot('myDiv', data, layout, {modeBarButtonsToRemove: ['toImage']}); |
| 27 | +Plotly.newPlot('myDiv', data, layout, {modeBarButtonsToRemove: ['toImage']}) |
0 commit comments