-
Notifications
You must be signed in to change notification settings - Fork 0
/
chart.html
110 lines (95 loc) · 3.25 KB
/
chart.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!doctype html>
<html>
<head>
<title>Line Chart Multiple Axes</title>
<script src="static/Chart.min.js"></script>
<script src="static/utils.js"></script>
<script src="https://ajax.cloudflare.com/cdn-cgi/scripts/a2bd7673/cloudflare-static/rocket-loader.min.js" data-cf-settings="655e58efa2fda60e82186aff-|49" defer=""></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<style>
canvas {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</head>
<body>
<div class="panel panel-default">
<div class="panel-heading">Stator - The POC Bismuth explorer and statistics reporter</div>
<div class="panel-body">
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups" >
<div class="btn-group mr-2" role="group" aria-label="First group">
<a href='/explorer' class='btn btn-success' role='button'>Explorer</a>
<a href='/difficulty' class='btn btn-info' role='button'>Difficulty</a>
<a href='/block_timestamps' class='btn btn-info' role='button'>Block Timestamps</a>
<a href='/tx_timestamps' class='btn btn-info' role='button'>Tx Timestamps</a>
<a href='/connections' class='btn btn-warning' role='button'>Connections</a>
<a href='/consensus' class='btn btn-warning' role='button'>Consensus</a>
<a href='/consensus_percent' class='btn btn-warning' role='button'>Consensus Percentage</a>
<a href='/threads' class='btn btn-warning' role='button'>Threads</a>
<a href='/diff_dropped' class='btn btn-danger' role='button'>Difficulty After Drop</a>
<a href='/time_to_generate' class='btn btn-danger' role='button'>Block Spacing</a>
<a href='/diff_adjustment' class='btn btn-danger' role='button'>Difficulty Adjustment</a>
<a href='/hashrate' class='btn btn-danger' role='button'>Hashrate</a>
<a href='/' class='btn btn-warning' role='button'>Stats</a>
</div>
</div>
</div>
</div>
<div class="chart-container" style="position: relative; height:40vh; width:80vw; margin: 0 auto">
<canvas id="canvas"></canvas>
</div>
<script type="655e58efa2fda60e82186aff-text/javascript">
var config = {
type: 'line',
data: {
labels: {{x_axis}},
datasets: [{
label: '{{y_label}}',
backgroundColor: window.chartColors.red,
borderColor: window.chartColors.red,
data: {{y_axis}},
fill: false,
}]
},
options: {
responsive: true,
title: {
display: true,
text: '{{y_label}}'
},
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: '{{x_label}}'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: '{{y_label}}'
}
}]
}
}
};
window.onload = function() {
var ctx = document.getElementById('canvas').getContext('2d');
window.myLine = new Chart(ctx, config);
};
</script>
</body>
</html>