prefer to produce wider graphs on dashboard
box@home root committed
Jun 19, 2013 at 23:12 UTC
d45b98d266239825e334127c7fd9803690a7b18d
1 file changed
+11
netdata.start
+11
@@ -65,6 +65,7 @@ fi
65
66
echo "Finding proper parameters for dashboard..."
67
68
+# count all JSON files
69
all=`ls "${data}" | grep .json$ | sed "s/\.json$//g"`
70
count=0
71
for x in $all
@@ -72,6 +73,7 @@ do
73
count=$[count + 1]
74
done
75
76
+# find the optimal graphs per page
77
w=1
78
h=1
79
a=1
@@ -86,6 +88,15 @@ do
88
fi
89
a=$[w*h]
90
done
91
+
92
+# prefer to have wider graphs
93
+if [ $w -gt $h ]
94
+then
95
+ w=$[w-1]
96
+ h=$[h+1]
97
+fi
98
+
99
+# make sure we don't display too small graphs
100
if [ $w -gt 10 ]
101
then
102
w=10