forked from preinheimer/xhprof
/
chart.phtml
executable file
·165 lines (156 loc) · 5.89 KB
/
chart.phtml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<script type="text/javascript">
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
margin: [80, 200, 60, 100],
zoomType: 'xy',
events:
{
click: function(e)
{
// find the clicked values and the series
var x = e.xAxis[0].value,
y = e.yAxis[0].value,
series = this.series[0];
}
}
},
credits: {
enabled:false
},
title: {
text: 'Data for XH Gui',
style: {
margin: '10px 0 0 0' // center it
}
},
subtitle: {
text: 'Source: XH Gui',
style: {
margin: '0 0 0 0' // center it
}
},
xAxis: [{
categories: [<?php echo $dateidsJS;?>],
labels: {
formatter: function() {
var date = (this.value).split(" ");
return date[0];
},
rotation: -45,
align: 'right',
}
}],
yAxis: [
{ // Primary yAxis
labels:
{
formatter: function() {
return this.value;
},
style: {
color: '#89A54E'
}
},
title: {
text: 'Peak Memory Usage',
style: {
color: '#89A54E'
},
margin: 80
},
opposite: true
}, { // Secondary yAxis
title: {
text: 'CPU',
margin: 50,
style: {
color: '#4572A7'
}
},
labels: {
formatter: function() {
return this.value;
},
style: {
color: '#4572A7'
}
}
}, { // Tertiary yAxis
title: {
text: 'Wall Time (ms)',
margin: 80,
style: {
color: '#AA4643'
}
},
labels: {
formatter: function() {
return this.value;
},
style: {
color: '#AA4643'
}
},
opposite: true,
offset: 100
}],
tooltip: {
formatter: function() {
var unit = {
'': '',
'': '',
'': ''
}[this.series.name];
return '<b>'+ this.series.name +'</b><br/><br/>' + this.y +'';
}
},
legend: {
layout: 'vertical',
style: {
left: '120px',
bottom: 'auto',
right: 'auto',
top: '90px'
},
backgroundColor: '#FFFFFF'
},
plotOptions: {
series: {
lineWidth: 1,
point: {
events: {
'click': function() {
if (this.series.data.length > 1)
{
var runid = (this.category).split(" ");
document.location = '?run=' + runid[2];
}
}
}
}
}
},
series: [{
name: 'CPU',
color: '#4572A7',
type: 'line',
yAxis: 1,
data: [<?php echo $cpuJS;?>],
},{
name: 'Wall Time',
type: 'line',
color: '#AA4643',
yAxis: 2,
data: [<?php echo $wtJS;?>]
},{
name: 'Peak Memory Usage',
color: '#89A54E',
type: 'line',
data: [<?php echo $pmuJS;?>,]
}]
});
});
</script>