vatsal-p-wa commited on
Commit
c18f65a
·
verified ·
1 Parent(s): d39c930

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -417,13 +417,27 @@ def report_view():
417
 
418
  has_prev = page > 1
419
  has_next = end_idx < total_records
 
 
 
 
 
 
 
 
 
420
 
421
  return render_template('output.html',
422
  table_html=table_html,
423
  report_type=report_type,
424
  page=page,
425
  has_prev=has_prev,
426
- has_next=has_next)
 
 
 
 
 
427
 
428
  # ------------------------------
429
  # Download Routes
 
417
 
418
  has_prev = page > 1
419
  has_next = end_idx < total_records
420
+
421
+ # ------------------ V changes --------------------------------------
422
+ # Prepare chart data (convert to JSON for JS)
423
+ chart_data = {
424
+ 'EngCts': df_page['EngCts'].tolist(),
425
+ 'Makable_Predicted': df_page['Makable_Predicted'].tolist(),
426
+ 'Makable_Diff': df_page['Makable_Diff'].tolist()
427
+ }
428
+ # ------------------ V changes --------------------------------------
429
 
430
  return render_template('output.html',
431
  table_html=table_html,
432
  report_type=report_type,
433
  page=page,
434
  has_prev=has_prev,
435
+ has_next=has_next,
436
+ # ------------------ V changes --------------------------------------
437
+ chart_data=json.dumps(chart_data)) # Pass JSON to template
438
+ # ------------------ V changes --------------------------------------
439
+ )
440
+
441
 
442
  # ------------------------------
443
  # Download Routes