Skip to content

Commit ef0fe6f

Browse files
committed
add grouptitle and handle click
1 parent 7870720 commit ef0fe6f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/components/legend/handle_click.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ module.exports = function handleClick(g, gd, numClicks) {
126126
var thisLegend = fullTrace.legend;
127127

128128
var fullInput = fullTrace._fullInput;
129-
var isShape = fullInput._isShape;
129+
var isShape = fullInput && fullInput._isShape;
130130

131131
if(!isShape && Registry.traceIs(fullTrace, 'pie-like')) {
132132
var thisLabel = legendItem.label;
1.53 KB
Loading

test/image/mocks/text_on_shapes_basic.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
"label":{"text":"top right", "textposition": "top right"}, "xref":"paper","yref":"paper","type":"circle","x0":0.3,"x1":0.35,"y0":0.2,"y1":0.4
2626
},
2727
{
28-
"showlegend": true, "legendgroup":"g1",
28+
"showlegend": true, "legendgroup":"g1", "legendgrouptitle": { "text": "1st group" },
2929
"label":{"text":"xanchor right, position not set<br> two lines", "xanchor":"right", "padding": 10, "font": {"family":"Courier New, monospace", "size":20}}, "xref":"paper","yref":"paper","type":"line","x0":0.8,"x1":0.9,"y0":0.8,"y1":0.9
3030
},
3131
{
3232
"showlegend": true, "legendgroup":"g1",
3333
"label":{"text":"position auto, xanchor center, angle -30", "xanchor":"center", "textangle":-30}, "layer":"below","x0":2,"x1":3,"y0":7,"y1":9.5,"opacity":0.5,"fillcolor":"#05e","line":{"width":3,"color":"#025","dash":"dashdot"}
3434
},
3535
{
36-
"showlegend": true, "legendgroup":"g2",
36+
"showlegend": true, "legendgroup":"g2", "legendgrouptitle": { "text": "2nd group" },
3737
"label":{"text":"position auto, yanchor top", "yanchor": "top"}, "yref":"paper","type":"line","x0":1.1,"x1":2.4,"y0":0.1,"y1":0.4,"line":{"color":"#039","dash":"dot","width":2}
3838
},
3939
{

0 commit comments

Comments
 (0)