mardi 19 octobre 2021

holoviz panel checkboxgroup updated value not being passed to the function

The code below renders the widget and the corresponding line chart. But when you check/uncheck additional checkboxes, the function doesn't seem to receive the updated values of checkboxgroup. The chart does not get updated with additional lines. Thanks in advance for your help. '''

    hsType = pn.widgets.CheckBoxGroup(name='Housing Types', value=['High'], options=['High','Medium','Low'])

    @pn.depends(hsType.param.value)

    def hsLinePlot(hsType):
         fig, uTLine = plt.subplots(figsize=(10,6))
         for col in hsType:
              uTLine.plot(df['Date'], df[col], label=col)
              #print(col)
         uTLine.legend()
         return uTLine
    pn.Column(hsType,hsLinePlot)

'''

line chart




Aucun commentaire:

Enregistrer un commentaire