]> git.ipfire.org Git - oddments/collecty.git/commitdiff
graphs: Make the first column slightly wider
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Sep 2020 12:16:34 +0000 (12:16 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Sep 2020 12:16:34 +0000 (12:16 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/collecty/constants.py
src/collecty/plugins/contextswitches.py
src/collecty/plugins/processor.py

index 0d4f81c67cd48aee8f13e3de0a92b0b5fb9ac369..f4b50e8bd907c13f8d8aa808cc4a3cca93d23dbe 100644 (file)
@@ -67,10 +67,12 @@ GRAPH_DEFAULT_WIDTH = 768
 GRAPH_DEFAULT_HEIGHT = 480
 
 # Default column widths
-LEGEND     = "%18s"
-LABEL      = "%-16s"
-PERCENTAGE = "%15.2lf%%"
-INTEGER    = "%18.0lf"
+LABEL       = "%-24s"
+EMPTY_LABEL = "%26s" % ""
+
+COLUMN      = "%16s"
+PERCENTAGE  = "%13.2lf%%"
+INTEGER     = "%16.0lf"
 
 EMPTY_LINE = "COMMENT: \\n"
 
index f16060983fbccf17c8aeff2429443752e4b21545..ff3d744fc56663273cc48fbc1f90404d45a23dc3 100644 (file)
@@ -34,11 +34,11 @@ class GraphTemplateContextSwitches(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "COMMENT:%s" % (LEGEND % ""),
-                       "COMMENT:%s" % (LEGEND % _("Current")),
-                       "COMMENT:%s" % (LEGEND % _("Average")),
-                       "COMMENT:%s" % (LEGEND % _("Minimum")),
-                       "COMMENT:%s\\j" % (LEGEND % _("Maximum")),
+                       "COMMENT:%s" % EMPTY_LABEL,
+                       "COMMENT:%s" % (COLUMN % _("Current")),
+                       "COMMENT:%s" % (COLUMN % _("Average")),
+                       "COMMENT:%s" % (COLUMN % _("Minimum")),
+                       "COMMENT:%s\\j" % (COLUMN % _("Maximum")),
 
                        "AREA:ctxt%s:%s" % (
                                lighten(PRIMARY, AREA_OPACITY),
@@ -48,7 +48,8 @@ class GraphTemplateContextSwitches(base.GraphTemplate):
                        "GPRINT:ctxt_avg:%s" % INTEGER,
                        "GPRINT:ctxt_min:%s" % INTEGER,
                        "GPRINT:ctxt_max:%s" % INTEGER,
-                       "LINE2:ctxt%s" % PRIMARY,
+
+                       "LINE1:ctxt%s" % PRIMARY,
                ]
 
        lower_limit = 0
index 5f6ab466a4053351bb478b70edb6c5c3d92a9664..e94f0aabc16cf34ea9ea345aaf84e25875901698 100644 (file)
@@ -41,11 +41,11 @@ class GraphTemplateProcessor(base.GraphTemplate):
                        "CDEF:total=usage,idle,+",
 
                        # Headline
-                       "COMMENT:%s" % (LEGEND % ""),
-                       "COMMENT:%s" % (LEGEND % _("Current")),
-                       "COMMENT:%s" % (LEGEND % _("Average")),
-                       "COMMENT:%s" % (LEGEND % _("Minimum")),
-                       "COMMENT:%s\\j" % (LEGEND % _("Maximum")),
+                       "COMMENT:%s" % EMPTY_LABEL,
+                       "COMMENT:%s" % (COLUMN % _("Current")),
+                       "COMMENT:%s" % (COLUMN % _("Average")),
+                       "COMMENT:%s" % (COLUMN % _("Minimum")),
+                       "COMMENT:%s\\j" % (COLUMN % _("Maximum")),
 
                        "CDEF:usage_p=100,usage,*,total,/",
                        "COMMENT:  %s" % (LABEL % _("Total")),