question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hbar issue stacked bar chart

See original GitHub issue

Hi,

I’ve created a horizontal stacked bar chart using hbar and experienced some strange behavior where bars with value 0 show up as a thin sliver.

Here’s a picture of said bar chart: bokeh_hbar

I’m using Bokeh 0.12.5 and Pandas 0.19.2 with Chrome. Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Aug 23, 2017

You’ll probably need to set the line color for the bar to None

On Aug 23, 2017, at 06:05, Steven Locorotondo notifications@github.com wrote:

Just upgraded and the issue persists.

Here is my code:

data = pd.DataFrame({ ‘Project’: [‘1’, ‘2’, ‘3’, ‘4’], ‘stack_1’: [0, 0, 0, 0], ‘stack_2’: [50, 75, 50, 40], ‘stack_3’: [100, 75, 75, 40], ‘data_1’: [50, 75, 50, 40], ‘data_2’: [100, 75, 75, 40], ‘data_3’: [120, 75, 75, 40], ‘Fulfilled’: [50, 75, 50, 40], ‘Fulfilled with new hires’: [50, 0, 25, 0], ‘Not fulfilled’: [20, 0, 0, 0], })

red = ‘#de2d26’ green = ‘#2ca25f’ amber = ‘#fec44f’ colors_ = [red, amber, green] bar_opts = dict(y=‘Project’, height=0.75)

hover = HoverTool(tooltips=[ (‘Project Name’, ‘@Project’), (“Fulfilled demand”, “@{Fulfilled}{int}”), (“Fulfilled with new hires”, “@{Fulfilled with new hires}{int}”), (“Not fulfilled”, “@{Not fulfilled}{int}”), ])

p = figure(plot_width=1000, plot_height=300, y_range=data[‘Project’].tolist()[::-1], title=‘Chart’, tools=[hover])

source = ColumnDataSource(data)

p.hbar(left=‘stack_1’, right=‘data_1’, source=source, **bar_opts, color=colors_[2], alpha=0.8) p.hbar(left=‘stack_2’, right=‘data_2’, source=source, **bar_opts, color=colors_[1], alpha=0.8) p.hbar(left=‘stack_3’, right=‘data_3’, source=source, **bar_opts, color=colors_[0], alpha=0.8)

show(p) The bars for projects 2, 3, and 4 illustrate my issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

1reaction
mattpapcommented, Aug 23, 2017

You will need to test this on 0.12.6, as this is the most recent stable version. If this still doesn’t work as expected, you need to provide a minimal code example for us to reproduce the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change default coloring in stacked bar chart? (sgplot, hbar..)
I am creating a lot of stacked bar charts in SAS using sgplot. ... My issue is that I would like to create...
Read more >
Report mean and N inside bars with - hbar - using the - stack
My problem is how can I stack the bars over the groups and have N reported ... label graph hbar hours, over(activity) over(group)...
Read more >
Bokeh Horizontal Stacked Bar Chart
I tried using hbar to create the rotation, but the chart still ends up staying in place. All tips appreciated! from bokeh.charts import...
Read more >
Stack bar chart selection of Hbar segment in javascript callback
Is there a way to select a segment of the stacked bar and get the index of the bar and the segment name...
Read more >
Re: st: hbar graph & colour - Stata
Subject, Re: st: hbar graph & colour ... nofill > > Even greater flexibility is given by recasting the problem as one for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found