This repository has been archived by the owner on Oct 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.js
53 lines (53 loc) · 1.66 KB
/
ui.js
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
$('#about').on('shown.bs.modal', function () {
vm.modalOpen = true;
var label = [];
var testData = [];
var hitData = [];
var stats = vm.statistics;
for (var i = stats.length - 1; i >= 0; i--) {
label.push(stats[i].MONTH);
testData.push(parseInt(stats[i].count));
hitData.push(parseInt(stats[i].hits));
};
var chartData = {
labels : label,
datasets : [
{
data : testData,
label: "Tests",
pointBorderColor: "rgba(75,192,192,1)",
pointBackgroundColor: "#fff",
pointBorderWidth: 1,
pointHoverRadius: 5,
pointHoverBackgroundColor: "rgba(75,192,192,1)",
pointHoverBorderColor: "rgba(220,220,220,1)",
pointHoverBorderWidth: 2,
pointRadius: 1,
pointHitRadius: 10,
borderColor:"#CC8400",
borderWidth: "3px"
},{
data : hitData,
label: "Hits",
pointBorderColor: "rgba(75,192,192,1)",
pointBackgroundColor: "#fff",
pointBorderWidth: 1,
pointHoverRadius: 5,
pointHoverBackgroundColor: "rgba(75,192,192,1)",
pointHoverBorderColor: "rgba(220,220,220,1)",
pointHoverBorderWidth: 2,
pointRadius: 1,
pointHitRadius: 10,
borderColor:"#cf7777",
borderWidth: "3px"
}
]};
var tests = document.getElementById('testCountCanvas').getContext('2d');
new Chart(tests, {
type:"line",
data:chartData
});
});
$('#about').on('hidden.bs.modal', function () {
vm.modalOpen = true;
});