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

[tor-commits] [atlas/master] Do not plot empty graphs



commit 3211eabe844ebbd0969940e5a399b0ce01c01728
Author: Raphael Bergmann <raphael@xxxxxxxxxx>
Date:   Thu Mar 2 12:06:00 2017 +0100

    Do not plot empty graphs
---
 js/views/details/main.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/js/views/details/main.js b/js/views/details/main.js
index f95e015..cc4d51a 100644
--- a/js/views/details/main.js
+++ b/js/views/details/main.js
@@ -26,6 +26,9 @@ define([
         plot: function(g, data, labels, legendPos, colors, tickFormat,
                        tooltipFormat) {
 
+            /* do not plot graph if there is no data */
+            if (data[0].length==0) return;
+
             /* Initialize graph. */
             var margin = {top: 30, right: 10, bottom: 20, left: 60},
                 width = 550 - margin.left - margin.right,

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits