This worked fine on ubuntu 14. Computer died, ported to new ubuntu 16. Same code still works fine when rendering a gridplot without legend instead.
Error:
Bokeh Error
Module
`LegendItem' does not exists. The problem may be two fold. Either a model was requested that's available in an extra bundle, e.g. a widget, or a custom model was requested, but it wasn't registered before first usage.
python:
if plot == ‘multi’:
p = figure(x_axis_type=“datetime”,plot_width=1000, plot_height=800, title=title)
p.grid.grid_line_alpha = 0.5
p.xaxis.axis_label = ‘Date (m-d)’
p.yaxis.axis_label = ‘Number of calls per day’
p.ygrid.band_fill_color = “olive”
p.ygrid.band_fill_alpha = 0.1
for k,v in unstacked.items():
if k in agencyList:
p.line(x=unstacked[‘Date’].tolist(), y=unstacked[k].tolist(), color=agencydict[k], legend=k) #p.line(x, y, color=‘navy’) #p.circle(x, y, color=‘navy’) #p = TimeSeries(unstacked, x_mapper_type=‘datetime’, xlabel=‘Date’, legend=True, title=title, ylabel=‘Number of calls per day’)
script, div = components(p)
return render_template(‘graph.html’, script=script, div=div)
``
in graph.html:
{% extends “base.html” %}
{% block title %} plot {% endblock %}
LegendItem is a recent addition in 0.12.3, but you are loading CDN resources from 0.12.2, which does not have it. That's the cause of the error. You need to update the CDN links in your template, or preferably, use a Resources object to automatically generate the JS and CSS with the appropriate version every time. Alternatively, you can downgrade your Bokeh install to version 0.12.2 as well.
This worked fine on ubuntu 14. Computer died, ported to new ubuntu 16. Same code still works fine when rendering a gridplot without legend instead.
Error:
Bokeh Error
Module `LegendItem' does not exists. The problem may be two fold. Either a model was requested that's available in an extra bundle, e.g. a widget, or a custom model was requested, but it wasn't registered before first usage.
python:
if plot == 'multi':
p = figure(x_axis_type="datetime",plot_width=1000, plot_height=800, title=title)
p.grid.grid_line_alpha = 0.5
p.xaxis.axis_label = 'Date (m-d)'
p.yaxis.axis_label = 'Number of calls per day'
p.ygrid.band_fill_color = "olive"
p.ygrid.band_fill_alpha = 0.1
for k,v in unstacked.items():
if k in agencyList:
p.line(x=unstacked['Date'].tolist(), y=unstacked[k].tolist(), color=agencydict[k], legend=k) #p.line(x, y, color='navy') #p.circle(x, y, color='navy') #p = TimeSeries(unstacked, x_mapper_type='datetime', xlabel='Date', legend=True, title=title, ylabel='Number of calls per day')
script, div = components(p)
return render_template('graph.html', script=script, div=div)
in graph.html:
{% extends "base.html" %}
{% block title %} plot {% endblock %}
Thank you Bryan, that was exactly it - didn’t realize I had a newer bokeh version already (it had been less than a month or 2? since installing it). Will look into the Resources object moving forward.
Thanks again.
···
On Thursday, November 10, 2016 at 1:28:00 PM UTC-5, Bryan Van de ven wrote:
LegendItem is a recent addition in 0.12.3, but you are loading CDN resources from 0.12.2, which does not have it. That’s the cause of the error. You need to update the CDN links in your template, or preferably, use a Resources object to automatically generate the JS and CSS with the appropriate version every time. Alternatively, you can downgrade your Bokeh install to version 0.12.2 as well.
This worked fine on ubuntu 14. Computer died, ported to new ubuntu 16. Same code still works fine when rendering a gridplot without legend instead.
Error:
Bokeh Error
Module `LegendItem’ does not exists. The problem may be two fold. Either a model was requested that’s available in an extra bundle, e.g. a widget, or a custom model was requested, but it wasn’t registered before first usage.
python:
if plot == ‘multi’:
p = figure(x_axis_type="datetime",plot_width=1000, plot_height=800, title=title)