aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/templates/graph_histogram.html
blob: 2f7a6bcc44cbe2c23d1cccd3846797555c0b59d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{{/*
Copyright 2024 syzkaller project authors. All rights reserved.
Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

Number of found bugs per month.
*/}}

<!doctype html>
<html>
<head>
	<title>{{.Title}}</title>
	{{template "head" .Header}}

	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
	<script type="text/javascript">
		google.load("visualization", "1", {packages:["corechart"]});
		google.setOnLoadCallback(function() {
			var data = new google.visualization.DataTable();
			data.addColumn({type: 'string'});
			{{range $.Graph.Headers}}
				data.addColumn({type: 'number', label: "{{.Name}}"});
			{{end}}
			data.addColumn({type: 'number', role: 'annotation'});
			data.addRows([
					{{range $.Graph.Columns}}
						["{{.Hint}}", {{range .Vals}}{{.Val}},{{end}} {{.Annotation}}],
					{{end}}
			]);
			new google.visualization.ColumnChart (
				document.getElementById('graph_div')).
				draw(data, {
					width: "100%",
					chartArea: {width: '90%', height: '85%'},
					legend: {position: 'in'},
					focusTarget: "category",
					isStacked: true,
					vAxis: {minValue: 1, textPosition: 'out', gridlines: {multiple: 1}, minorGridlines: {multiple: 1}},
					hAxis: {minValue: 1, textPosition: 'out', maxAlternation: 1, gridlines: {multiple: 1}, minorGridlines: {multiple: 1}},
					series: {
						{{range $idx, $hdr := $.Graph.Headers}}
							{{$idx}}: {color: "{{$hdr.Color}}"},
						{{end}}
					},
					annotations: { textStyle: { color: 'black', bold: true }},
				})
		});
	</script>
</head>
<body>
	{{template "header" .Header}}
	<div id="graph_div"></div>
</body>
</html>