Przeglądaj źródła

Graph: Day of Week.

Heikki Hokkanen 18 lat temu
rodzic
commit
1a51d24df5
1 zmienionych plików z 20 dodań i 1 usunięć
  1. 20
    1
      statgit

+ 20
- 1
statgit Wyświetl plik

@@ -323,6 +323,7 @@ class HTMLReportCreator(ReportCreator):
323 323
 				f.write('<td>0</td>')
324 324
 			f.write('</tr>')
325 325
 		f.write('</table>')
326
+		f.write('<img src="day_of_week.png" />')
326 327
 		fp.close()
327 328
 
328 329
 		# Commits by year/month
@@ -445,10 +446,25 @@ set output 'hour_of_day.png'
445 446
 unset key
446 447
 set xrange [0.5:24.5]
447 448
 set xtics 4
449
+set ylabel "Commits"
448 450
 plot 'hour_of_day.dat' using 1:2:(0.5) w boxes fs solid
449 451
 """)
450 452
 		f.close()
451 453
 
454
+		# day of week
455
+		f = open(path + '/day_of_week.plot', 'w')
456
+		f.write(GNUPLOT_COMMON)
457
+		f.write(
458
+"""
459
+set output 'day_of_week.png'
460
+unset key
461
+set xrange [0.5:7.5]
462
+set xtics 1
463
+set ylabel "Commits"
464
+plot 'day_of_week.dat' using 1:2:(0.5) w boxes fs solid
465
+""")
466
+		f.close()
467
+
452 468
 		# commits_by_year_month
453 469
 		f = open(path + '/commits_by_year_month.plot', 'w')
454 470
 		f.write(GNUPLOT_COMMON)
@@ -460,6 +476,8 @@ unset key
460 476
 set xdata time
461 477
 set timefmt "%Y-%m"
462 478
 set format x "%Y-%m"
479
+set xtics 15768000
480
+set ylabel "Commits"
463 481
 plot 'commits_by_year_month.dat' using 1:2:(0.5) w boxes fs solid
464 482
 """)
465 483
 		f.close()
@@ -472,12 +490,13 @@ plot 'commits_by_year_month.dat' using 1:2:(0.5) w boxes fs solid
472 490
 set output 'commits_by_year.png'
473 491
 unset key
474 492
 set xtics 1
493
+set ylabel "Commits"
475 494
 plot 'commits_by_year.dat' using 1:2:(0.5) w boxes fs solid
476 495
 """)
477 496
 		f.close()
478 497
 
479 498
 		os.chdir(path)
480
-		for i in ('hour_of_day', 'commits_by_year_month', 'commits_by_year'):
499
+		for i in ('hour_of_day', 'day_of_week', 'commits_by_year_month', 'commits_by_year'):
481 500
 			os.system('gnuplot %s.plot' % i)
482 501
 
483 502
 		pass