gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r18598 - gnunet-gtk/src/statistics


From: gnunet
Subject: [GNUnet-SVN] r18598 - gnunet-gtk/src/statistics
Date: Thu, 15 Dec 2011 13:05:10 +0100

Author: grothoff
Date: 2011-12-15 13:05:10 +0100 (Thu, 15 Dec 2011)
New Revision: 18598

Modified:
   gnunet-gtk/src/statistics/gtk_statistics.c
Log:
-also draw a line if we only have one data point

Modified: gnunet-gtk/src/statistics/gtk_statistics.c
===================================================================
--- gnunet-gtk/src/statistics/gtk_statistics.c  2011-12-15 09:51:58 UTC (rev 
18597)
+++ gnunet-gtk/src/statistics/gtk_statistics.c  2011-12-15 12:05:10 UTC (rev 
18598)
@@ -472,7 +472,22 @@
     h += te.height / 2 + 1.0;
     cairo_show_text (cr, vh->label);
     if (xmax == xmin) 
+    {
+      hv = &vh->history[vh->last_history_offset % MAX_HISTORY];
+      ry = hv->y / (double) ymax;
+      ry = BORDER + tex_max.height / 2.0 + (1.0 - ry) * (height - BORDER * 2.0 
- tey_max.height - tex_max.height);
+      /* if y-values are small, offset y-values a bit to allow overlapping 
curves to still show up */
+      if (ymax < height / (priv->num_values * 4))
+       ry += priv->num_values * 2 - (4 * i);
+      cairo_move_to (cr, 
+                    width - BORDER - tex_max.width / 2.0, 
+                    ry);      
+      cairo_line_to (cr, 
+                    rx = tey_max.width + BORDER * 2.0,
+                    ry);
+      cairo_stroke (cr);
       continue;
+    }
 
     for (j=0;j<vh->history_size;j++)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]