Reputation: 3665
I'm using Bokeh in a Python Flask app. In the test_app.py
file have this code:
def make_figure():
plot = figure(tools=TOOLS, width=750, height=450, title='United States Import/Exports',
x_axis_label='date', x_axis_type='datetime')
plot.line(dframe.index, dframe.get('Exports'), color='#A6CEE3', legend='Exports')
return plot
@app.route('/')
def greet():
greetings = 'Hello World, I am BOKEH'
plot = make_figure()
script, div = components(plot)
return render_template('index.html', greetings=greetings, script=script, div=div)
if __name__ == '__main__':
app.run(debug=True)
In the index.html
file, I have the following core part along with the required js
and css
links:
<body>
<h1>{{ greetings | safe }} </h1>
{{ script | safe }}
{{ div | safe }}
</body>
Problem is, the Bokeh canvas, controls, etc show up but the line plot itself does not. What am I missing in this code?
Upvotes: 1
Views: 2278