[LNT] r306593 - Don't mix int and str on the x axis

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 13:45:02 PDT 2017


Author: cmatthews
Date: Wed Jun 28 13:45:02 2017
New Revision: 306593

URL: http://llvm.org/viewvc/llvm-project?rev=306593&view=rev
Log:
Don't mix int and str on the x axis

This was causing some graphs to render funny.

Modified:
    lnt/trunk/lnt/server/ui/views.py

Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=306593&r1=306592&r2=306593&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Wed Jun 28 13:45:02 2017
@@ -884,6 +884,7 @@ def v4_graph():
         else:
             normalize_by = 1.0
 
+        using_ints = True
         for pos, (point_label, datapoints) in enumerate(data):
             # Get the samples.
             data = [data_date[0] for data_date in datapoints]
@@ -895,7 +896,9 @@ def v4_graph():
             # When we can, map x-axis to revisions, but when that is too hard
             # use the position of the sample instead.
             rev_x = convert_revision(point_label)
-            x = rev_x[0] if len(rev_x)==1 else pos
+            if using_ints and len(rev_x) != 1:
+                using_ints = False
+            x = rev_x[0] if using_ints else pos
 
             values = [v*normalize_by for v in data]
             aggregation_fn = min




More information about the llvm-commits mailing list