Skip to content

Commit

Permalink
Fix drop down
Browse files Browse the repository at this point in the history
  • Loading branch information
roshnet committed Mar 2, 2019
1 parent 4e79f6d commit 1978246
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/gva_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
main_sections = [index for index in sections.index if sections[index].isdigit()]
rows = [data.iloc[idx] for idx in main_sections]
labels = [row.iloc[-1] for row in rows]
labelIds = [row.iloc[-2] for row in rows]
labelIds = main_sections

layout = html.Div([
html.H1('Stock Tickers'),
html.H1('GVA Time Series'),
dcc.Dropdown(
id='my-dropdown',
options=[{'label': category, 'value': labelIds[idx]} for (idx, category) in enumerate(labels)],
Expand All @@ -35,9 +35,8 @@
@app.callback(Output('my-graph', 'figure'),
[Input('my-dropdown', 'value')])
def update_graph(selected_dropdown_value):
print(selected_dropdown_value)
index = int(selected_dropdown_value)
row = process.iloc[index, 2:-2].values
row = data.iloc[index][2:-2]
year_list = ['Y ' + year for year in years.values[0]]
mid = int(len(row)/2)
return {
Expand Down

0 comments on commit 1978246

Please sign in to comment.