<jupyter_start><jupyter_text>New to Plotly?Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/).You can set up Plotly to work in [online](https://plot.ly/python/getting-started/initialization-for-online-plotting) or [offline](https://plot.ly/python/getting-started/initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plot.ly/python/getting-started/start-plotting-online).We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!  Version CheckNote: `Bullet Charts` are available in version 2.2.2+Run  `pip install plotly --upgrade` to update your Plotly version<jupyter_code>import plotly
plotly.__version__<jupyter_output><empty_output><jupyter_text>Simple Bullet Chart<NAME>'s Bullet Chart was invented to replace dashboard gauges and meters, combining both types of charts into simple bar charts with qualitative bars (`ranges`), quantitiative bars (`measures`) and performance points (`markers`) all into one simple layout. `ranges` typically are broken into three values: bad, okay, good, the `measures` are the darker bars that represent the actual values that a particular variable reached, and the points or `markers` usually indicate a goal point relative to the value achieved by the measure bar.To use this figure factory, you can input either a pandas DataFrame as your data, or a sequence (ex. list, tuple, np.array, etc.) of dictionaries. You must map the column to the name of the particular column or key in your data. For example, if you want column `A` in your DataFrame to be the `measures` column, your function call will look like:```ff.create_bullet(data, measures='A', ...)```The valid params to set your DataFrame columns or dictionary keys to are `titles`, `subtitles`, `ranges`, `measures` and `markers`. The variable for `titles` and `subtitles` must contain strings as its elements and the rest lists.<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import pandas as pd

data = pd.read_json('https://cdn.rawgit.com/plotly/datasets/master/BulletData.json')

fig = ff.create_bullet(
    data, markers='markers', measures='measures',
    ranges='ranges', subtitles='subtitle', titles='title',
)
py.iplot(fig, filename='bullet chart from a dataframe')<jupyter_output><empty_output><jupyter_text>Vertical Bullet ChartThis example uses a tuple of dictionaries as its data input.<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

data = (
  {"label": "Revenue", "sublabel": "US$, in thousands",
   "range": [150, 225, 300], "performance": [220,270], "point": [250]},
  {"label": "Profit", "sublabel": "%", "range": [20, 25, 30],
   "performance": [21, 23], "point": [26]},
  {"label": "Order Size", "sublabel":"US$, average","range": [350, 500, 600],
   "performance": [100,320],"point": [550]},
  {"label": "New Customers", "sublabel": "count", "range": [1400, 2000, 2500],
   "performance": [1000, 1650],"point": [2100]},
  {"label": "Satisfaction", "sublabel": "out of 5","range": [3.5, 4.25, 5],
   "performance": [3.2, 4.7], "point": [4.4]}
)

fig = ff.create_bullet(
    data, titles='label', subtitles='sublabel', markers='point',
    measures='performance', ranges='range', orientation='v',
)
py.iplot(fig, filename='bullet chart from dict')<jupyter_output><empty_output><jupyter_text>Use Your Own ColorsYou can use different colors for the `range` and the `measure` columns. Set `range_colors` and `measure_colors` to a 2-item list of two colors to interpolate between.<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import pandas as pd

data = pd.read_json('https://cdn.rawgit.com/plotly/datasets/master/BulletData.json')

measure_colors=['rgb(63,102,153)', 'rgb(120,194,195)']
range_colors=['rgb(245,225,218)', 'rgb(241,241,241)']


fig = ff.create_bullet(
    data, orientation='h', markers='markers', measures='measures',
    ranges='ranges', subtitles='subtitle', titles='title',
    range_colors=range_colors,
    measure_colors=measure_colors
)
py.iplot(fig, filename='bullet chart - custom colors')<jupyter_output><empty_output><jupyter_text>Custom Kwargs<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import pandas as pd

data = pd.read_json('https://cdn.rawgit.com/plotly/datasets/master/BulletData.json')

fig = ff.create_bullet(
    data, orientation='v', markers='markers', measures='measures',
    ranges='ranges', subtitles='subtitle', titles='title',
    title='lots of kwargs', width=600, showlegend=True,
    scatter_options={'marker': {'size': 30,
                                'color': 'rgb(21, 166, 20)',
                                'symbol': 'hourglass'}}
    
)

# group legends
chart_elements = 6  # 3 grey bars, 2 blue bars, 1 marker
for cols, title in enumerate(data['title']):
    for ele in range(chart_elements):
        if ele == 0:
            showlegend = True
        else:
            showlegend = False
        fig['data'][cols * 6 + ele].update(
            {
                'legendgroup': '{}'.format(title),
                'name': title,
                'showlegend': showlegend
            }
        )

py.iplot(fig, filename='bullet chart - custom kwargs')<jupyter_output><empty_output><jupyter_text>Reference<jupyter_code>help(ff.create_bullet)
! pip install git+https://github.com/plotly/publisher.git --upgrade
import publisher
publisher.publish(
    'bullet-chart.ipynb', 'python/bullet-charts/', 'Bullet Charts',
    "How to create Stephen Few Bullet Charts in Python with Plotly.",
    title = 'Python Bullet Charts | plotly',
    has_thumbnail='true', thumbnail='thumbnail/bullet_charts.jpg',
    language='python',
    display_as='statistical', order=9)<jupyter_output>Collecting git+https://github.com/plotly/publisher.git
  Cloning https://github.com/plotly/publisher.git to /private/var/folders/tc/bs9g6vrd36q74m5t8h9cgphh0000gn/T/pip-UhEHKw-build
Installing collected packages: publisher
  Found existing installation: publisher 0.11
    Uninstalling publisher-0.11:
      Successfully uninstalled publisher-0.11
  Running setup.py install for publisher ... [?25ldone
[?25hSuccessfully installed publisher-0.11
{'fraction_non_alphanumeric': 0.13488080301129235, 'fraction_numerical': 0.026976160602258468, 'mean_word_length': 4.703935599284437, 'pattern_counts': {'":': 25, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '315304', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 2153, 'n_tokens_neox': 1948, 'n_words': 572, 'path': '_posts/python-v3/statistical/bullet/bullet-chart.ipynb', 'repo_name': 'bmb804/documentation', 'size': '6381'}