Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f32f92b

Browse files
author
“mahdis-z”
committed
automargin
1 parent 20e4e68 commit f32f92b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Automatically Adjust Margins
3+
plot_url: https://codepen.io/plotly/embed/pooamyd/?height=500&theme-id=15263&default-tab=result
4+
language: plotly_js
5+
suite: pie
6+
order: 4
7+
sitemap: false
8+
arrangement: horizontal
9+
markdown_content: |
10+
The following example sets [automargin](https://plot.ly/javascript/setting-graph-size/#automatically-adjust-margins) attribute to true, which automatically increases the margin size.
11+
---
12+
var data = [{
13+
type: "pie",
14+
values: [2, 3, 4, 4],
15+
labels: ["Wages", "Operating expenses", "Cost of sales", "Insurance"],
16+
textinfo: "label+percent",
17+
textposition: "outside",
18+
automargin: true
19+
}]
20+
21+
var layout = {
22+
height: 400,
23+
width: 400,
24+
margin: {"t": 0, "b": 0, "l": 0, "r": 0},
25+
showlegend: false
26+
}
27+
28+
Plotly.newPlot('graph', data, layout)

0 commit comments

Comments
 (0)