forked from highcharts/highcharts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresize.htm
82 lines (75 loc) · 1.86 KB
/
resize.htm
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="edit-Type" edit="text/html; charset=utf-8">
<title>Highcharts Resize Study</title>
<script type="text/javascript" src="/js/jquery.js">
</script>
<script type="text/javascript" src="/js/highcharts.src.js">
</script>
<script type="text/javascript" src="/js/modules/exporting.src.js">
</script>
</head>
<body>
<script type='text/javascript'>
function getRandomData() {
var data = [];
for (var i = 0; i < 5; i++) {
data.push(Math.random());
}
return data;
}
var chart,
large;
$(document).ready(function(){
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'line',
borderWidth: 1,
backgroundColor: '#FFFFEF',
plotBorderWidth: 0,
animation: {
//duration: 1000
}
},
xAxis: {
title: {
text: 'X axis'
},
categories: ['Ein', 'Tvo', 'Tri','Fir']
},
yAxis: {
title: {
text: 'Primary'
}/*,
plotBands: [{
from: 2,
to: 3,
color: 'red'
}]*/
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
formatter: function() {
return Highcharts.numberFormat(this.y, 2);
}
}
}
},
series: [{
data: getRandomData()//[1,3,2,4]
}]
});
$('#shift').click(function(){
chart.series[0].addPoint(Math.random(), true, true, true);
});
});
</script>
<button id="shift">Shift</button>
<div id="container" style="height: 300px; width: 400px">
</div>
</body>
</html>