python 3.x - Missing value on a Bar chart tooltip -
this question has answer here:
i having problem bokeh bar chart. here code:
from bkcharts import bar bokeh.models import factorrange # make bokeh push push output jupyter notebook. bokeh.io import push_notebook, show, output_notebook bokeh.resources import inline output_notebook(resources=inline) bokeh.models import hovertool data = { 'name' : [chan['name'] chan in full_channels_info], 'members' : [chan['num_members'] chan in full_channels_info] } hover = hovertool(tooltips=[ ("channel", "@name"), ("users", "@members"), ]) chart = bar(data, values='members', label='name', title="channels population", plot_width=1000, xlabel="channel", ylabel="members", legend=none, tools=[hover]) show(chart) the problem being when hover on 1 of bars, tooltip looks this:
the issue in hovertool() should refer @height instead of @members.
hover = hovertool(tooltips=[ ("channel", "@name"), ("users", "@height"), ]) 
Comments
Post a Comment