Org Api Collection Code
Org Api Collection Code
html.Div([
html.Label("Yearly Collection:"),
dcc.Graph(id='yearly-collection-graph')
], style={'width': '50%', 'display': 'inline-block'}),
])
# Define callback to update the monthly and yearly collection graphs based on live
data
@app.callback(
[Output('monthly-collection-graph', 'figure'),
Output('yearly-collection-graph', 'figure')],
[Input('month-dropdown', 'value'),
Input('year-dropdown', 'value')]
)
def update_graphs(selected_month, selected_year):
# Fetch live collection data for the selected month and year from an API -
replace with your actual API endpoint
response =
requests.get(f'https://api.example.com/live-collection-data/{selected_year}/
{selected_month}')
monthly_collections = response.json()['monthly_collections']
yearly_collections = response.json()['yearly_collections']