2017-01-24 16:09:09 +00:00
|
|
|
users = ["christoffermadsen","jmaa","jacob","alexander"]
|
|
|
|
log_dir = "./log/"
|
2017-01-24 16:42:54 +00:00
|
|
|
plotstring = %Q[set terminal 'svg' size 1000,400
|
|
|
|
set output "/home/christoffermadsen/public_html/img/screenshot_count.svg"
|
2017-01-24 16:37:27 +00:00
|
|
|
set title "Screenshot count"
|
|
|
|
set key bottom outside
|
|
|
|
|
|
|
|
set style line 1 lt 1 lw 2 pt 7 ps 0.4
|
|
|
|
|
2017-01-24 16:09:09 +00:00
|
|
|
set xdata time
|
|
|
|
set timefmt "%s"
|
|
|
|
set format x "%m/%d"
|
|
|
|
set yrange [0:500]
|
2017-01-24 16:37:27 +00:00
|
|
|
set xlabel "Time"
|
|
|
|
set ylabel "Count"
|
|
|
|
set ytics 100
|
|
|
|
set mytics 2
|
|
|
|
set grid ytics mytics xtics
|
|
|
|
set grid
|
|
|
|
set xtics 432000
|
|
|
|
|
2017-01-24 16:09:09 +00:00
|
|
|
plot ]
|
|
|
|
|
|
|
|
users.each do |user|
|
2017-01-24 16:37:27 +00:00
|
|
|
colour = "%06x" % (rand * 0xffffff)
|
|
|
|
plotstring += %Q["log/#{user}.log" using 1:2 with lines ls 1 lc rgb '##{colour}' t "#{user}", \\\n]
|
2017-01-24 16:09:09 +00:00
|
|
|
end
|
|
|
|
output = File.open("plotscript","w")
|
|
|
|
output << plotstring
|
|
|
|
output.close
|