-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathchart.html
123 lines (123 loc) · 4.82 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
111
112
113
114
115
116
117
118
119
120
121
122
123
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.src.js"></script>
<script src="jso.js"></script>
<script>
$(function () {
var param = new URLSearchParams(window.location.search);
var simid = param.get('simid');
var json = 'https://www.raidbots.com/reports/' + simid + '/data.json';
$.getJSON(json, function(data) {
var base = data.sim.players[0].name;
var profiles = data.sim.profilesets.results;
var options = {
chart: {
type: 'bar',
backgroundColor: '#242424',
spacingLeft: 0,
spacingTop: 5,
style: {
fontFamily: 'monospace'
}
},
title: {
text: '<a target=\"_top\" style=\"color:#FF7D0A;\" href=\"https://www.raidbots.com/simbot/report/' + simid + '\">Open Report</a>',
useHTML: true,
align: 'left',
margin: 0,
x: 60,
y: 10,
style: {
color: '#FF7D0A',
fontSize: '1em'
}
},
subtitle: {
text: 'Click bar for single target Talent Sim',
floating: true,
align: 'left',
x: 222,
y: 10,
style: {
color: '#FF7D0A'
}
},
yAxis: {
visible: false,
width: '35%'
},
xAxis: {
type: 'category',
lineWidth: 0,
labels: {
style: {
color: '#FF7D0A',
fontSize: '15px'
},
x: -85
}
},
legend: {
enabled: false
},
series: [{
animation: {
duration: 350
},
color: '#FF7D0A',
pointWidth: 17,
borderWidth: 0,
point: {
events: {
click: function() {
location.href = this.options.url;
parent.setTitle(this.options.name);
}
}
},
dataLabels: {
enabled: true,
inside: true,
align: 'left',
format: '{y:.2f}',
x: -80,
style: {
fontSize: '15px',
color: '#FF7D0A',
fontWeight: 'bold',
textOutline: '0px'
}
},
dataSorting: {
enabled: true,
sortKey: 'y'
},
name: 'DPS',
data: []
}]
};
$.each(profiles, function(k, v) {
let url = '';
if (typeof jso[v.name] != 'undefined') {
url = 'https://www.raidbots.com/reports/' + jso[v.name] + '/index.html';
}
options.series[0].data[k] = {'name': v.name, 'y': v.mean, 'url': url};
});
Highcharts.chart('container', options);
let sel_tar = parent.document.getElementById('targets').selectedIndex + 1;
let tar_str = sel_tar.toString() + ' Target' + (sel_tar == 1 ? '' : 's');
if (sel_tar == 7) {
tar_str = 'Dungeon';
} else if (sel_tar == 6) {
tar_str = '1 Target Movement';
}
parent.setTitle(base + ' ' + tar_str);
});
});
</script>
</head>
<body style="margin:0;">
<div id="container" style="height:2200px"></div>
</body>
</html>