# Dash multi-selection options

**URL:** <https://community.plotly.com/t/dash-multi-selection-options/11162>\
**Category:** Dash Python\
**Created:** [June 25, 2018, 2:09pm UTC](https://community.plotly.com/t/dash-multi-selection-options/11162 "2018-06-25T14:09:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vg1](https://avatars.discourse-cdn.com/v4/letter/v/c67d28/32.png) [@vg1](https://community.plotly.com/u/vg1)\
**Post date:** [June 25, 2018, 2:09pm UTC](https://community.plotly.com/t/dash-multi-selection-options/11162/1 "2018-06-25T14:09:21Z")

</div>

I am trying to sum data using multi-selection options as the input and outputting a bar graph.

Right now, the code I have is just summing for the default values set for the dropdowns. It is summing instances of where type = A and ind = 0. However, when I select additional options into the dropdowns, the callback is not recognizing those outputs and is not automatically updating the data.

![test_table](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/6/61a13a07f53c437254611055da05505c320c112b.JPG)

import dash  
import dash\_core\_components as dcc  
import dash\_html\_components as html

import pandas as pd  
import matplotlib.pyplot as plt  
%matplotlib inline

from plotly import **version**  
from plotly.offline import download\_plotlyjs, init\_notebook\_mode, plot, iplot  
import plotly.plotly as py  
import plotly.graph\_objs as go  
import plotly.figure\_factory as FF  
import numpy as np

df = pd.read\_excel(‘test\_file.xlsx’, ‘Sheet1’)

type\_options = df[‘TYPE’].unique()  
ind\_options = df[‘IND’].unique()

app = dash.Dash()

app.layout = html.Div(children=[  
html.H1(children=‘Dashboard’, style={  
‘textAlign’: ‘center’,  
}),  
html.P(‘Type’),  
dcc.Dropdown(  
id=‘typePicker’,  
options=[{‘label’: i, ‘value’: i} for i in type\_options],  
value=‘A’,  
multi=True  
),

```
html.P('Ind'),
dcc.Dropdown(
    id='indPicker',
    options=[{'label': i, 'value': i} for i in ind_options],
    value='0',
    multi=True
),

dcc.Graph(
    id='sales-graph'
)

```

])

@app.callback(  
dash.dependencies.Output(‘sales-graph’, ‘figure’),  
[dash.dependencies.Input(‘typePicker’, ‘value’),  
dash.dependencies.Input(‘indPicker’, ‘value’)])  
def update\_graph(typeP, indP):

```
test_graph = df[df['TYPE'].isin([typeP]) & df['IND'].isin([indP])]
myArray = np.array(test_graph['April_sales'])
total = np.sum(myArray)

return {

    'data': [
        go.Bar(
            x = ['April Sales'],
            y = [total]
        ) 
    ],
    'layout': go.Layout(
        yaxis={'title': 'sales'},
        barmode='stack',
        hovermode='closest'
    )
}

```

if **name** == ‘ **main** ’:  
app.run\_server()

The error I’m getting is “ERROR in app: Exception on /\_dash-update-component [POST]”  
and “TypeError: unhashable type: ‘list’”
