stacked vbars not updating on callback

Hello,

I am building a stacked vbar graph as shown below. I couldn’t get vbar_stack to work, so I built it manually as described here: https://bokeh.pydata.org/en/latest/docs/reference/plotting.html#bokeh.plotting.figure.Figure.vbar_stack

So I am looping through creating a vbar for each part of the stacked bar, adding the column names to the bottom and top lists as the loop progresses

#initialize looping variables
bottom_fields =

top_fields =

#bars is a dict that contains a column name from the data source (key) and a color (value).
#Not all of the columns in the data source are called from bars

for column_name in bars.keys():
#loops through bars dict

#append first column to identify top of part of stack

top_fields.append(column_name)

#plot vbar, using looped bottom and top locations

self.plot.vbar(bottom=stack(*bottom_fields),

top=stack(*top_fields),

x=‘Timestamp’,

width=width_group*timeseries_mod,

source=self.source,

color = bars[column_name][‘color’],

line_color = None)

#updates bottom location

bottom_fields.append(column_name)

``

I’m running a periodic update script that works on other single vbars in different figures from the same script (but calling a normal vbar setup, where top=columnn_name, and I’ve confirmed that the data source is getting updated for the columns in the data source for the stacked bar figure. However the displayed figure is not updating to reflect the new values, even when only one bar is rendered this way. Refreshing the page updates the graph.

I’m stumped, so I’m wondering if there’s anything weird about using periodic callbacks on stacked bars that I can’t find. Thanks for any help or advice.

Hi,

This might be something we have to investigate. Please make a GitHub issue with a *complete* reproducer.

Thanks,

Bryan

···

On Apr 19, 2018, at 07:17, Zach Sizemore <[email protected]> wrote:

Hello,

I am building a stacked vbar graph as shown below. I couldn't get vbar_stack to work, so I built it manually as described here: https://bokeh.pydata.org/en/latest/docs/reference/plotting.html#bokeh.plotting.figure.Figure.vbar_stack
So I am looping through creating a vbar for each part of the stacked bar, adding the column names to the bottom and top lists as the loop progresses

#initialize looping variables
bottom_fields =
top_fields =

#bars is a dict that contains a column name from the data source (key) and a color (value).
#Not all of the columns in the data source are called from bars
for column_name in bars.keys():
    #loops through bars dict

    #append first column to identify top of part of stack
    top_fields.append(column_name)

    #plot vbar, using looped bottom and top locations
    self.plot.vbar(bottom=stack(*bottom_fields),
                   top=stack(*top_fields),
                   x='Timestamp',
                   width=width_group*timeseries_mod,
                   source=self.source,
                   color = bars[column_name]['color'],
                   line_color = None)

    #updates bottom location
    bottom_fields.append(column_name)

I'm running a periodic update script that works on other single vbars in different figures from the same script (but calling a normal vbar setup, where top=columnn_name, and I've confirmed that the data source is getting updated for the columns in the data source for the stacked bar figure. However the displayed figure is not updating to reflect the new values, even when only one bar is rendered this way. Refreshing the page updates the graph.

I'm stumped, so I'm wondering if there's anything weird about using periodic callbacks on stacked bars that I can't find. Thanks for any help or advice.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae62e3e3-1197-47cf-8b65-206e6631674e%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Bryan,

Will do. See https://github.com/bokeh/bokeh/issues/7823.

···

On Friday, April 20, 2018 at 10:59:25 AM UTC-4, Bryan Van de ven wrote:

Hi,

This might be something we have to investigate. Please make a GitHub issue with a complete reproducer.

Thanks,

Bryan

On Apr 19, 2018, at 07:17, Zach Sizemore [email protected] wrote:

Hello,

I am building a stacked vbar graph as shown below. I couldn’t get vbar_stack to work, so I built it manually as described here: https://bokeh.pydata.org/en/latest/docs/reference/plotting.html#bokeh.plotting.figure.Figure.vbar_stack

So I am looping through creating a vbar for each part of the stacked bar, adding the column names to the bottom and top lists as the loop progresses

#initialize looping variables

bottom_fields =

top_fields =

#bars is a dict that contains a column name from the data source (key) and a color (value).

#Not all of the columns in the data source are called from bars

for column_name in bars.keys():

#loops through bars dict
#append first column to identify top of part of stack
top_fields.append(column_name)
#plot vbar, using looped bottom and top locations
self.plot.vbar(bottom=stack(*bottom_fields),
               top=stack(*top_fields),
               x='Timestamp',
               width=width_group*timeseries_mod,
               source=self.source,
               color = bars[column_name]['color'],
               line_color = None)
#updates bottom location
bottom_fields.append(column_name)

I’m running a periodic update script that works on other single vbars in different figures from the same script (but calling a normal vbar setup, where top=columnn_name, and I’ve confirmed that the data source is getting updated for the columns in the data source for the stacked bar figure. However the displayed figure is not updating to reflect the new values, even when only one bar is rendered this way. Refreshing the page updates the graph.

I’m stumped, so I’m wondering if there’s anything weird about using periodic callbacks on stacked bars that I can’t find. Thanks for any help or advice.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae62e3e3-1197-47cf-8b65-206e6631674e%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.