From 113bdf9afb5139e82c44a9b6e9b41658acb3e4dd Mon Sep 17 00:00:00 2001
From: Bruce Allen <bdallen@nps.edu>
Date: Fri, 9 Oct 2020 17:44:44 -0700
Subject: [PATCH] fix scale

---
 python/views/gantt_chart.py | 4 +++-
 python/views/make_views.py  | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/views/gantt_chart.py b/python/views/gantt_chart.py
index 4a9eb3c..12d517c 100644
--- a/python/views/gantt_chart.py
+++ b/python/views/gantt_chart.py
@@ -46,16 +46,18 @@ class GanttChart(QGraphicsItem):
         bar_name_widths = list()
         self.bar_starts = list()
         self.bar_stops = list()
+        bar_starts_plus_stops = list()
         for name, start, stop in bars:
             self.bar_names.append(name)
             bar_name_widths.append(_text_width(name))
             self.bar_starts.append(start)
             self.bar_stops.append(stop)
+            bar_starts_plus_stops.append(start + stop)
         self.max_bar_value = max(self.bar_stops)
         self.max_bar_name_w = max(bar_name_widths) + 4
         self.num_bars = len(bars)
         if self.bar_stops:
-            _max = max(self.bar_stops)
+            _max = max(bar_starts_plus_stops)
             if _max:
                 self.bar_scale = MAX_BAR_W / _max
             else:
diff --git a/python/views/make_views.py b/python/views/make_views.py
index 957fe83..077a1a1 100644
--- a/python/views/make_views.py
+++ b/python/views/make_views.py
@@ -46,7 +46,6 @@ def make_view(json_view, default_x, default_y):
         view = Graph(json_view, default_x, default_y)
     elif json_view["type"] == "BAR_CHART":
         data = json_view["data"]
-        print("data",data)
         if data["ROTATE"] == 0:
             view = BarChart(json_view, default_x, default_y)
         elif data["ROTATE"] == 1:
-- 
GitLab