Scale PV curve graph to production max only

This commit is contained in:
Joan
2026-03-20 13:36:25 +01:00
parent e957583de5
commit 2ad0319e30

View File

@@ -715,12 +715,10 @@ class Matrix64Display(SampleBase):
graphics.DrawText(canvas, small_font, 10, 38, label_color, "Sin datos") graphics.DrawText(canvas, small_font, 10, 38, label_color, "Sin datos")
return return
# Find max across both datasets for shared scale # Scale to PV production max (main focus of this view)
max_val = 1 max_val = 1
if self.pv_history: if self.pv_history:
max_val = max(max_val, max(p for _, p in self.pv_history)) max_val = max(max_val, max(p for _, p in self.pv_history))
if self.consumption_history:
max_val = max(max_val, max(p for _, p in self.consumption_history))
# Labels above graph area (with margin) # Labels above graph area (with margin)
if max_val >= 1000: if max_val >= 1000: