forked from ankeshanand/benchmark
/
chart.html
55 lines (51 loc) · 1.42 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
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/highcharts.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/exporting.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/themes/dark-unica.js"></script>
</head>
<body>
<div id="container" style="width:50%; height:400px"></div>
</body>
<script>
$(function () {
$(document).ready(function(){
var options = {
chart: {
renderTo: 'container',
type: ''
},
title: {
text: ''
},
xAxis: {
title: {
text: ''
},
categories: []
},
yAxis: {
title: {
text: ''
}
},
series: [{}]
};
$.getJSON('plots/{{ plotname }}/data/',function(data){
options.chart.type = data.chart_type;
options.series[0].data = data.values;
options.xAxis.categories = data.categories;
options.title.text = data.chart_title;
options.xAxis.title.text = data.xAxis_title_text;
options.yAxis.title.text = data.yAxis_title_text;
console.log(options);
Highcharts.setOptions(Highcharts.theme);
var chart = new Highcharts.Chart(options);
});
});
});
</script>
</html>