Skip to content

Commit 71e9053

Browse files
committed
update bottle bokeh post
1 parent 5e693f7 commit 71e9053

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Posts and associated code:
77

88
|Post|Code Directory|Notes|
99
|---|---|---|
10+
|[Creating Bar Chart Visuals with Bokeh, Bottle and Python 3](https://www.fullstackpython.com/blog/python-bottle-bokeh-bar-charts.html)|[bar-charts-bokeh-bottle-python-3](https://github.com/fullstackpython/blog-code-examples/tree/master/bar-charts-bokeh-bottle-python-3)||
1011
|[How to Add Hosted Monitoring to Flask Web Applications](https://www.fullstackpython.com/blog/hosted-monitoring-flask-web-apps.html)|[monitor-flask-apps](https://github.com/fullstackpython/blog-code-examples/tree/master/monitor-flask-apps)||
1112
|[Responsive Bar Charts with Bokeh, Flask and Python 3](https://www.fullstackpython.com/blog/responsive-bar-charts-bokeh-flask-python-3.html)|[bar-charts-bokeh-flask-python-3](https://github.com/fullstackpython/blog-code-examples/tree/master/bar-charts-bokeh-flask-python-3)||
1213
|[How to Create Your First Python 3.6 AWS Lambda Function](https://www.fullstackpython.com/blog/aws-lambda-python-3-6.html)|[aws-lambda-python-3-6](https://github.com/fullstackpython/blog-code-examples/tree/master/aws-lambda-python-3-6)||

bar-charts-bokeh-bottle-python-3/app.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,19 @@ def chart(num_bars):
5151

5252

5353
def create_hover_tool():
54-
# we'll code this function in a moment
55-
return None
54+
"""Generates the HTML for the Bokeh's hover data tool on our graph."""
55+
hover_html = """
56+
<div>
57+
<span class="hover-tooltip">$x</span>
58+
</div>
59+
<div>
60+
<span class="hover-tooltip">@bugs bugs</span>
61+
</div>
62+
<div>
63+
<span class="hover-tooltip">$@costs{0.00}</span>
64+
</div>
65+
"""
66+
return HoverTool(tooltips=hover_html)
5667

5768

5869
def create_bar_chart(data, title, x_name, y_name, hover_tool=None,

0 commit comments

Comments
 (0)