You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add `legend.xref` and `legend.yref` to enable container-referenced positioning for plot legends [[#6589](https://github.com/plotly/plotly.js/pull/6589)], with thanks to [Gamma Technologies](https://www.gtisoft.com/) for sponsoring the related development.
Copy file name to clipboardExpand all lines: test/plot-schema.json
+22-6
Original file line number
Diff line number
Diff line change
@@ -2980,10 +2980,8 @@
2980
2980
"valType": "boolean"
2981
2981
},
2982
2982
"x": {
2983
-
"description": "Sets the x position (in normalized coordinates) of the legend. Defaults to *1.02* for vertical legends and defaults to *0* for horizontal legends.",
2983
+
"description": "Sets the x position with respect to `xref` (in normalized coordinates) of the legend. When `xref` is *paper*, defaults to *1.02* for vertical legends and defaults to *0* for horizontal legends. When `xref` is *container*, defaults to *1* for vertical legends and defaults to *0* for horizontal legends. Must be between *0* and *1* if `xref` is *container*. and between *-2* and *3* if `xref` is *paper*.",
2984
2984
"editType": "legend",
2985
-
"max": 3,
2986
-
"min": -2,
2987
2985
"valType": "number"
2988
2986
},
2989
2987
"xanchor": {
@@ -2998,11 +2996,19 @@
2998
2996
"right"
2999
2997
]
3000
2998
},
2999
+
"xref": {
3000
+
"description": "Sets the container `x` refers to. *container* spans the entire `width` of the plot. *paper* refers to the width of the plotting area only.",
3001
+
"dflt": "paper",
3002
+
"editType": "layoutstyle",
3003
+
"valType": "enumerated",
3004
+
"values": [
3005
+
"container",
3006
+
"paper"
3007
+
]
3008
+
},
3001
3009
"y": {
3002
-
"description": "Sets the y position (in normalized coordinates) of the legend. Defaults to *1* for vertical legends, defaults to *-0.1* for horizontal legends on graphs w/o range sliders and defaults to *1.1* for horizontal legends on graph with one or multiple range sliders.",
3010
+
"description": "Sets the y position with respect to `yref` (in normalized coordinates) of the legend. When `yref` is *paper*, defaults to *1* for vertical legends, defaults to *-0.1* for horizontal legends on graphs w/o range sliders and defaults to *1.1* for horizontal legends on graph with one or multiple range sliders. When `yref` is *container*, defaults to *1*. Must be between *0* and *1* if `yref` is *container* and between *-2* and *3* if `yref` is *paper*.",
3003
3011
"editType": "legend",
3004
-
"max": 3,
3005
-
"min": -2,
3006
3012
"valType": "number"
3007
3013
},
3008
3014
"yanchor": {
@@ -3015,6 +3021,16 @@
3015
3021
"middle",
3016
3022
"bottom"
3017
3023
]
3024
+
},
3025
+
"yref": {
3026
+
"description": "Sets the container `y` refers to. *container* spans the entire `height` of the plot. *paper* refers to the height of the plotting area only.",
0 commit comments