BaşlayınÜcretsiz Başlayın

Box annotations for sales performance

The bakery has asked for one last plot from you. The visualization will display sales by date with two box annotations, so they can easily see which dates are under their revenue target of $250.

A figure, fig, with line glyphs, has been created using the code below:

sales = bakery.groupby("date", as_index=False)["sales"].sum()
source = ColumnDataSource(data=sales)
fig = figure(x_axis_label="Date", y_axis_label="Revenue ($)")
fig.line(x="date", y="sales", source=source)
fig.xaxis[0].formatter = DatetimeTickFormatter(months="%b %Y")

fig is preloaded for you. Your task is to create box annotations to show where sales in the bakery dataset are above or below $250.

Bu egzersiz

Interactive Data Visualization with Bokeh

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create low_box
low_box = ____(____=____, ____=____, ____='____')

# Create high_box
high_box = ____(____=____, ____=____, ____='____')
Kodu Düzenle ve Çalıştır