vibhorag101 commited on
Commit
c9b69d1
1 Parent(s): 80f6abb

Removed the pie chart

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -147,10 +147,9 @@ def update_sip_calculator(*args):
147
  result += "Individual scheme returns:\n"
148
  for scheme_name, scheme_return in scheme_returns:
149
  result += f"{scheme_name}: {scheme_return:.2f}%\n"
150
-
151
- pie_chart = create_pie_chart(schemes)
152
-
153
- return result, pie_chart, final_value, total_investment
154
 
155
  def fetch_scheme_data():
156
  url = "https://api.mfapi.in/mf"
@@ -290,9 +289,9 @@ def create_ui():
290
  calculate_button = gr.Button("Calculate Returns")
291
 
292
  result = gr.Textbox(label="Results")
293
- pie_chart = gr.Plot(label="Scheme Weightages")
294
- final_value = gr.Number(label="Final Value (₹)", interactive=False)
295
- total_investment = gr.Number(label="Total Investment (₹)", interactive=False)
296
 
297
  def update_custom_date_visibility(period):
298
  return {custom_start_date: gr.update(visible=period=="Custom"),
@@ -367,7 +366,9 @@ def create_ui():
367
  calculate_button.click(
368
  lambda *args: update_sip_calculator(*prepare_inputs_with_inception(*args)),
369
  inputs=[period, custom_start_date, custom_end_date, SIP_Date, sip_amount, schemes_list, gr.State(schemes_df), use_inception_date, inception_date_display],
370
- outputs=[result, pie_chart, final_value, total_investment]
 
 
371
  )
372
 
373
  return app
 
147
  result += "Individual scheme returns:\n"
148
  for scheme_name, scheme_return in scheme_returns:
149
  result += f"{scheme_name}: {scheme_return:.2f}%\n"
150
+ # pie_chart = create_pie_chart(schemes)
151
+ # return result, pie_chart, final_value, total_investment
152
+ return result
 
153
 
154
  def fetch_scheme_data():
155
  url = "https://api.mfapi.in/mf"
 
289
  calculate_button = gr.Button("Calculate Returns")
290
 
291
  result = gr.Textbox(label="Results")
292
+ # pie_chart = gr.Plot(label="Scheme Weightages")
293
+ # final_value = gr.Number(label="Final Value (₹)", interactive=False)
294
+ # total_investment = gr.Number(label="Total Investment (₹)", interactive=False)
295
 
296
  def update_custom_date_visibility(period):
297
  return {custom_start_date: gr.update(visible=period=="Custom"),
 
366
  calculate_button.click(
367
  lambda *args: update_sip_calculator(*prepare_inputs_with_inception(*args)),
368
  inputs=[period, custom_start_date, custom_end_date, SIP_Date, sip_amount, schemes_list, gr.State(schemes_df), use_inception_date, inception_date_display],
369
+ outputs=[result]
370
+ # outputs=[result, final_value, total_investment]
371
+ # outputs=[result, pie_chart, final_value, total_investment]
372
  )
373
 
374
  return app