Skip to content

Commit 2b02713

Browse files
committed
change layout from dict to Layout
1 parent 6d91d4e commit 2b02713

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

plotly/tools.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,8 +2440,8 @@ def create_ohlc(open, high, low, close,
24402440
dates, **kwargs)
24412441
data = [ohlc_incr, ohlc_decr]
24422442

2443-
layout = dict(xaxis=dict(zeroline=False),
2444-
hovermode='closest')
2443+
layout = graph_objs.Layout(xaxis=dict(zeroline=False),
2444+
hovermode='closest')
24452445

24462446
return dict(data=data, layout=layout)
24472447

@@ -2755,13 +2755,15 @@ def create_candlestick(open, high, low, close,
27552755
**kwargs)
27562756
data = candle_incr_data + candle_decr_data
27572757

2758-
layout = dict(barmode='stack',
2759-
bargroupgap=0.2,
2760-
yaxis=dict(fixedrange=True,
2761-
range=[(min(low) -
2762-
((max(high) - min(low)) * .1)),
2763-
(max(high) +
2764-
((max(high) - min(low)) * .1))]))
2758+
layout = graph_objs.Layout(barmode='stack',
2759+
bargroupgap=0.2,
2760+
yaxis=dict(range=[(min(low) -
2761+
((max(high) - min(low)) *
2762+
.1)),
2763+
(max(high) + ((max(high) -
2764+
min(low)) *
2765+
.1))]))
2766+
layout['yaxis']['fixedrange'] = True
27652767

27662768
return dict(data=data, layout=layout)
27672769

0 commit comments

Comments
 (0)