forked from plotly/graphing-library-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2020-01-24-remove-modebarButtons.html
27 lines (25 loc) · 1.38 KB
/
2020-01-24-remove-modebarButtons.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
name: Remove ModeBar Buttons
language: plotly_js
suite: configuration
order: 5.5
sitemap: false
arrangement: horizontal
markdown_content: |
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:
<ul>
<li><b>2D:</b> `zoom2d`, `pan2d`, `select2d`, `lasso2d`, `zoomIn2d`, `zoomOut2d`, `autoScale2d`, `resetScale2d` </li>
<li><b>3D:</b> `zoom3d`, `pan3d`, `orbitRotation`, `tableRotation`, `handleDrag3d`, `resetCameraDefault3d`, `resetCameraLastSave3d`, `hoverClosest3d` </li>
<li><b>Cartesian:</b> `hoverClosestCartesian`, `hoverCompareCartesian` </li>
<li><b>Geo:</b> `zoomInGeo`, `zoomOutGeo`, `resetGeo`, `hoverClosestGeo` </li>
<li><b>Other:</b> `hoverClosestGl2d`, `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `sendDataToCloud`, `toggleSpikelines`, `resetViewMapbox` </li>
</ul>
---
var data = [{
x:['trees', 'flowers', 'hedges'],
y: [90, 130, 40],
type: 'bar'}]
var layout = {
title: 'Remove Modebar Buttons',
showlegend: false}
Plotly.newPlot('myDiv', data, layout, {modeBarButtonsToRemove: ['toImage']})