Newbie question. Starting my dashboard by creating a chart with selectable series using panel in VScode notebook.
Code cell is:
import holoviews as hv import hvplot.pandas hv.extension('bokeh') import panel as pn nselect = pn.widgets.Checkbox(name='nsw',value = True) vselect = pn.widgets.Checkbox(name='vic') mypane = pn.Pane bound_plot = pn.bind(price_plot, nsw=nselect, vic=vselect) pn.Column(nselect, vselect, bound_plot)
price_plot function code is:
def price_plot(nsw,vic): cstate =  if nsw: cstate.append("nsw") if vic: cstate.append("vic") return spri[cstate].groupby(level =).mean().plot()
Runs fine on first run:
But every time a check box is ticked or unticked a new figure is produced. I was expecting the original figure to adjust but maybe I, as an amateur, just don’t understand how it works? I can only upload one image but in words when I check the “vic” box a new chart is drawn below the original figure with “nsw” and “vic” series