无法使radiobuttongroup工作

时间:2017-11-10 20:23:03

标签: python radio-button bokeh

尝试使用Bokeh库快速实现单选按钮。编程新手。在以下代码中,仪表板确实显示按钮和表,但按钮不起作用

def createAndConfigureDashboard(self, name, dimensions, plotData, doOpenTheDashboard):
    figure = output_file(name)
    source, columns = plotData['Data_Table'].returnDataTableForThisOption(0)
    dataTable = DT(source=source, 
                    columns=columns, 
                    width=400, 
                    height=700)
    callback = CustomJS(args=dict(source=source), code="""
        var data = source.get('data');
        f = cb_obj.get('active')
        data = {'Parameter': []}
        source.trigger('change');
        """)
    radio_button_group = RadioButtonGroup(labels=["Section - 1", 'Section - 2', "Section - 3", "Section - 4"], callback = callback)
    dashboardLayout = layout([
              [radio_button_group],
                [dataTable],
          ],
          sizing_mode='fixed')
    show(dashboardLayout)

0 个答案:

没有答案