@@ -238,49 +238,40 @@ def create_bullet(
238
238
for more information on valid params.
239
239
240
240
Example 1: Use a Dictionary
241
- ```
242
- import plotly
243
- import plotly.plotly as py
244
- import plotly.figure_factory as ff
245
-
246
- data = [
247
- {"label": "Revenue", "sublabel": "US$, in thousands",
248
- "range": [150, 225, 300], "performance": [220,270], "point": [250]},
249
- {"label": "Profit", "sublabel": "%", "range": [20, 25, 30],
250
- "performance": [21, 23], "point": [26]},
251
- {"label": "Order Size", "sublabel":"US$, average","range": [350, 500, 600],
252
- "performance": [100,320],"point": [550]},
253
- {"label": "New Customers", "sublabel": "count", "range": [1400, 2000, 2500],
254
- "performance": [1000, 1650],"point": [2100]},
255
- {"label": "Satisfaction", "sublabel": "out of 5","range": [3.5, 4.25, 5],
256
- "performance": [3.2, 4.7], "point": [4.4]}
257
- ]
258
-
259
- fig = ff.create_bullet(
260
- data, titles='label', subtitles='sublabel', markers='point',
261
- measures='performance', ranges='range', orientation='h',
262
- title='my simple bullet chart'
263
- )
264
- py.iplot(fig)
265
- ```
241
+
242
+ >>> import plotly.figure_factory as ff
243
+
244
+ >>> data = [
245
+ ... {"label": "revenue", "sublabel": "us$, in thousands",
246
+ ... "range": [150, 225, 300], "performance": [220,270], "point": [250]},
247
+ ... {"label": "Profit", "sublabel": "%", "range": [20, 25, 30],
248
+ ... "performance": [21, 23], "point": [26]},
249
+ ... {"label": "Order Size", "sublabel":"US$, average","range": [350, 500, 600],
250
+ ... "performance": [100,320],"point": [550]},
251
+ ... {"label": "New Customers", "sublabel": "count", "range": [1400, 2000, 2500],
252
+ ... "performance": [1000, 1650],"point": [2100]},
253
+ ... {"label": "Satisfaction", "sublabel": "out of 5","range": [3.5, 4.25, 5],
254
+ ... "performance": [3.2, 4.7], "point": [4.4]}
255
+ ... ]
256
+
257
+ >>> fig = ff.create_bullet(
258
+ ... data, titles='label', subtitles='sublabel', markers='point',
259
+ ... measures='performance', ranges='range', orientation='h',
260
+ ... title='my simple bullet chart'
261
+ ... )
262
+ >>> fig.show()
266
263
267
264
Example 2: Use a DataFrame with Custom Colors
268
- ```
269
- import plotly.plotly as py
270
- import plotly.figure_factory as ff
271
-
272
- import pandas as pd
273
265
274
- data = pd.read_json('https://cdn.rawgit.com/plotly/datasets/master/BulletData.json')
266
+ >>> import plotly.figure_factory as ff
267
+ >>> import pandas as pd
268
+ >>> data = pd.read_json('https://cdn.rawgit.com/plotly/datasets/master/BulletData.json')
275
269
276
- fig = ff.create_bullet(
277
- data, titles='title', markers='markers', measures='measures',
278
- orientation='v', measure_colors=['rgb(14, 52, 75)', 'rgb(31, 141, 127)'],
279
- scatter_options={'marker': {'symbol': 'circle'}}, width=700
280
-
281
- )
282
- py.iplot(fig)
283
- ```
270
+ >>> fig = ff.create_bullet(
271
+ ... data, titles='title', markers='markers', measures='measures',
272
+ ... orientation='v', measure_colors=['rgb(14, 52, 75)', 'rgb(31, 141, 127)'],
273
+ ... scatter_options={'marker': {'symbol': 'circle'}}, width=700)
274
+ >>> fig.show()
284
275
"""
285
276
# validate df
286
277
if not pd :
0 commit comments