Skip to content

Commit 2c68db5

Browse files
author
Jon M. Mease
committed
Some fixes for bullet figure_factor
1 parent 3773ba9 commit 2c68db5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plotly/figure_factory/_bullet.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def _bullet(df, markers, measures, ranges, subtitles, titles, orientation,
5656
width_axis = 'xaxis'
5757
length_axis = 'yaxis'
5858

59-
for key in fig['layout'].keys():
60-
if 'axis' in key:
59+
for key in fig['layout']:
60+
if 'xaxis' in key or 'yaxis' in key:
6161
fig['layout'][key]['showgrid'] = False
6262
fig['layout'][key]['zeroline'] = False
6363
if length_axis in key:
@@ -100,7 +100,7 @@ def _bullet(df, markers, measures, ranges, subtitles, titles, orientation,
100100
xaxis='x{}'.format(row + 1),
101101
yaxis='y{}'.format(row + 1)
102102
)
103-
fig['data'].append(bar)
103+
fig.add_traces(bar)
104104

105105
# measures bars
106106
for idx in range(len(df.iloc[row]['measures'])):
@@ -126,7 +126,7 @@ def _bullet(df, markers, measures, ranges, subtitles, titles, orientation,
126126
xaxis='x{}'.format(row + 1),
127127
yaxis='y{}'.format(row + 1)
128128
)
129-
fig['data'].append(bar)
129+
fig.add_traces(bar)
130130

131131
# markers
132132
x = df.iloc[row]['markers'] if orientation == 'h' else [0.5]
@@ -141,7 +141,7 @@ def _bullet(df, markers, measures, ranges, subtitles, titles, orientation,
141141
**scatter_options
142142
)
143143

144-
fig['data'].append(markers)
144+
fig.add_traces(markers)
145145

146146
# titles and subtitles
147147
title = df.iloc[row]['titles']
@@ -159,7 +159,7 @@ def _bullet(df, markers, measures, ranges, subtitles, titles, orientation,
159159
True if orientation == 'h' else False,
160160
False
161161
)
162-
fig['layout']['annotations'].append(annot)
162+
fig['layout']['annotations'] += (annot,)
163163

164164
return fig
165165

0 commit comments

Comments
 (0)