[hamster-applet/2_28_no_bars] horizontal to the max



commit e2d4c3076e75ce5da18377fc9918545b86ff3881
Author: Toms Bauģis <toms baugis gmail com>
Date:   Tue Nov 10 20:48:09 2009 +0000

    horizontal to the max

 hamster/charting.py |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)
---
diff --git a/hamster/charting.py b/hamster/charting.py
index 9bfb59e..713a836 100644
--- a/hamster/charting.py
+++ b/hamster/charting.py
@@ -124,7 +124,7 @@ class Chart(graphics.Area):
 
         self.max_bar_width     = args.get("max_bar_width", 500)
         self.legend_width      = args.get("legend_width", 0)
-        self.animate           = args.get("animate", True)
+        self.animate           = False
 
         self.background        = args.get("background", None)
         self.chart_background  = args.get("chart_background", None)
@@ -436,9 +436,6 @@ class HorizontalBarChart(Chart):
         self.graph_y, self.graph_height = 0, self.height
 
 
-        if self.chart_background:
-            self.fill_area(self.graph_x, self.graph_y, self.graph_width, self.graph_height, self.chart_background)
-
     
         if not self.data:  #if we have nothing, let's go home
             return
@@ -484,20 +481,18 @@ class HorizontalBarChart(Chart):
             if self.stack_keys:
                 bar_start = 0
                 for j, factor in enumerate(self.integrators[i]):
-                    if factor.value > 0:
-                        bar_size = max_bar_size * factor.value
-                        bar_height = bar_width - (gap * 2)
-                        
-                        last_color = self.get_bar_color(j)
-                        self.draw_bar(self.graph_x + bar_start,
-                                      bar_y,
-                                      bar_size,
-                                      bar_height,
-                                      last_color)
-                        bar_start += bar_size
+                    bar_size = max_bar_size
+                    bar_height = bar_width - (gap * 2)
+                    
+                    last_color = self.get_bar_color(j)
+                    self.draw_bar(self.graph_x + bar_start,
+                                  bar_y,
+                                  bar_size,
+                                  bar_height,
+                                  last_color)
+                    bar_start += bar_size
             else:
-                factor = self.integrators[i].value
-                bar_size = max_bar_size * factor
+                bar_size = max_bar_size
                 bar_start = bar_size
 
                 bar_height = bar_width - (gap * 2)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]