Hi
I have some indicators on a dash and I was wondering if it’s possible to detect when they are clicked on?
My indicators are built like so:
dcc.Graph(id="cpi")
@app.callback(Output("cpi", "figure"),
[Input("area", "value")])
def cpi_indicator(area):
...
layout = dict(paper_bgcolor="white", plot_bgcolor="white", margin=dict(l=0, r=0, t=0, b=0, pad=0))
data = go.Indicator(value=this_month, mode="number+delta", delta=dict(reference=delta,
increasing=dict(color="#231f20", symbol=''), decreasing=dict(color="#231f20", symbol=''), relative=False, valueformat=",."),
number={"font" : dict(color=color), "valueformat": ",."})
indicator = go.Figure(data=data, layout=layout)
return indicator
And I have tried a callback like this:
@app.callback(Output("test", "children"),
[Input("cpi", "n_clicks")])
def cpi_indicator(n_clicks):
print(n_clicks)
if n_clicks != None:
return "test"
But the callback is not being called?