Hi everyone, I am struggling to Output the value of x which would correspond to when “Turnover” equal “Costs” (see the screenshot). I was wondering if there was any equation that would solve this and How should I reorganise my @appcallback ?
Thank you very much for the help ! It is greatly appreciated
@app.callback(
Output(component_id='our_graph', component_property='figure'),
[Input(component_id='Estimated_Annual_tCO2', component_property='value'),
Input(component_id='Price_tCO2', component_property='value'),
Input(component_id='Hectares_of_land', component_property='value'),
Input(component_id='Variables_costs_ha', component_property='value'),
Input(component_id='Gap_analysis_fee', component_property='value'),
Input(component_id='Audit_fee', component_property='value')]
)
def update_graph(Est_ann_emissions, Price, Hectares_of_land, Var_costs_ha, Gap_fee, Audit_fee):
x=np.arange(0, 11)
y=x*Est_ann_emissions*Price
b= 8375 + Est_ann_emissions*0.1*x + 0.05*Est_ann_emissions*x + 0.02*Est_ann_emissions*x + 2500*x + Gap_fee + Audit_fee + Hectares_of_land*Var_costs_ha
fig = go.Figure()
fig.add_trace(go.Scatter(x=x, y=y, name='Turnover')),
fig.add_trace(go.Scatter(x=x, y=b, name='Costs'))
return fig