Help needed: the x-axis lost control in Panel dashboard

Hi,

I am working on a project which I want to plot the data based on datasets (Data Set) and sub-datasets(AFEs). It works great in Jupyter lab. see below:

But it doesn’t work as good when It is in Panel Dashboard:

As you see that, the x axis extended when I select the sub-dataset control (AFE).
Any idea what could be wrong?
Thanks,
Jeff

Can you share sample code?

Hi riziles,

I have two Panel widgets:

data_set_sel = pn.widgets.IntSlider( name='Data Set', start=0, end=int(data_set-1), step=1, value=0)
afe_btn = pn.widgets.RadioButtonGroup(name='AFE', options={'AFE1': 0, 'AFE2': 1, 'AFE3': 2, 'AFE4': 3}, button_type='success')

I am using hvplot.bind to bind the function and the widgets value:

d_set = data_set_sel.value
afe = afe_btn.value

def filt_df(d_set, afe):
    df2 = df[['EL', 'CB1 Window', 'CB1 Delay', 'CB2 Window', 'CB2 Delay']]
    return df2[(df2.index < (el_0[d_set] + afe*16)+16) &   (df2.index >= (el_0[d_set] + afe*16))]

df_output = hvplot.bind(filt_df, data_set_sel, afe_btn).interactive()

It works great with plotting in Jupyter lab:

CB1 = df_output.hvplot.bar(x='EL', y=['CB1 Delay', 'CB1 Window'], stacked=True, width=600, legend='top', ylim=[0, 31])
CB2 = df_output.hvplot.bar(x='EL', y=['CB2 Delay', 'CB2 Window'], stacked=True, width=600, legend='top')

CB1 + CB2

But, it got problem with Panel dashboard:

#Layout using Template
template = pn.template.FastListTemplate(
    title='LVDS Locking Analysis', 
    sidebar=[pn.pane.Markdown("# LVDS LOCKING"), 
             pn.pane.Markdown("#### descriptin here......"), 
             # pn.pane.PNG('climate_day.png', sizing_mode='scale_both'),
             pn.pane.Markdown("## Open Log File"),   
             logfile],
    main=[pn.Row(pn.Column(fn,
                           data_set_sel, 
                           afe_btn), pn.Spacer(width=50),
                 pn.Column(LVDS_Status1, 
                           FPGA_Temp),pn.Spacer(width=50),
                 pn.Column(LVDS_Status2)),
          pn.Row(CB1.panel(width=600), CB2.panel(width=600), margin=(0,25)),
          pn.Row(pn.Column(table.panel(width=600)))],
    accent_base_color="#88d8b0",
    header_background="#88d8b0",
)
template.show()
template.servable();

You may notice that I have “template.show()” here. When run this cell in Jupyter, it will auto open panel dashboard on browser.

Thanks,
Jeff

Sorry, there’s just way too many undefined variables in your sample code. I would recommend trying to replicate the behavior while slowly stripping away various parts piece by piece. Once you have a minimal example, then post the code including some way to generate sample data.