@app.callback(
Output(component_id="Pie", component_property="figure"),
Input(component_id="storage", component_property="data")
)
def pie_chart(storage_data):
dt = json.loads(storage_data)
df = pd.DataFrame(dt)
fig = px.pie(df, values="Number of stocks", names="Direction", labels="Direction", hole=0.3, hover_data=None,
title="Stocks")
dic = {
"showlegend": False,
"paper_bgcolor": "#171a24",
"plot_bgcolor": "#171a24",
"modebar_remove": True,
"font": dict(color="white")
}
fig.update_traces(textposition="inside", textinfo="label+percent")
fig.update_layout(dic)
return fig
i have been trying to convert this callback to a client callback for hours but i can’t, i am not familiar with javascript at all., how should i approach the process?