Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

How to add title for dcc.RadioItems

$
0
0

图片

Hi, does anyone can help me on how to add the title in the red box as the pic showed. I want to keep the current style for RadioItems, but when I try to add ‘title’ in my code comment line#title here, it reports an error “ NameError: name ‘sen_layout’ is not defined”.

Here is my code:

sen_layout = html.Div([
html.Div(
#title here
dcc.RadioItems(
id=str(scenarios[0]),
options=[{‘label’: i, ‘value’: i} for i in [‘No US’, ‘US Cont’,‘US 50%’]],
value=‘No US’,
)
,style={‘width’: ‘5%’, ‘display’: ‘inline-block’}
),

                  html.Div(
                  dcc.RadioItems(
                                      id=str(scenarios[1]),
                                      options=[{'label': i, 'value': i} for i in ['No US', 'US Cont','US 50%']],
                                      value='No US',
                                  )
                   ,style={'width': '5%', 'display': 'inline-block'}
                   ), 
                  
                  html.Div( 
                  dcc.RadioItems(
                                      id=str(scenarios[2]),
                                      options=[{'label': i, 'value': i} for i in ['No US', 'US Cont','US 50%']],
                                      value='No US', 
                                  ),style={'width': '5%', 'display': 'inline-block'}
                  ),
                     
              ])

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles