hi,
as the title suggests im trying to render a graph (pie chart in this case) based on the selection of a radio button
i’ve followed a starter tutorial and can display an image to a div based on the selection made in a radio button but have not been able to figure out how to make a different graph show up for each radio button selection.
This is what my radio button options look like:
dcc.RadioItems(
id='radio-items',
options = [
{'label': 'One', 'value': 'first'},
{'label': 'Two', 'value': 'second'},
{'label': 'Three', 'value': 'third'},
],
value = "",
labelStyle={'display': 'inline-block'}
),
i’ve made the ‘value’ key in my ‘options’ list just some dummy strings like ‘first’,‘second’,‘third’ in an attempt to just output random text. but now i want the ‘value’ that is renderd from each selection to be a pie chart. is there a standard way to go about doing this?? what i’ve tried is literally putting a ‘go.Pie’ as the ‘value’ in each ‘option’ dictionary but 1. it just doesnt seem right and 2. can’t get it to work cuz i cant figure out what the heck my callback is supposed to have in it… has anyone seen an example for something like this online??
thank u