-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patharearange_sample.html
123 lines (115 loc) · 4.05 KB
/
arearange_sample.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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HighStock for ExtJS 4</title>
<link rel="stylesheet" type="text/css" href="http://cdn.sencha.com/ext/gpl/4.2.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://cdn.sencha.com/ext/gpl/4.2.1/examples/shared/example.css" />
<script type="text/javascript" src="http://cdn.sencha.com/ext/gpl/4.2.1/bootstrap.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/stock/highstock.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/stock/highcharts-more.js"></script>
<script type="text/javascript" src="http://joekuan.org/highstocks_extjs4/ux/HighStock.js"></script>
<script type="text/javascript" src="http://joekuan.org/highstocks_extjs4/ux/HighStockSerie.js"></script>
<script type='text/javascript'>
Ext.Loader.setConfig({
enabled : true,
disableCaching : false, // For debug only
paths : {
'Chart' : 'Chart'
}
});
Ext.require('Chart.ux.HighStock');
Ext.application({
name : 'HighStock',
launch : function() {
Ext.define('StockData', {
extend : 'Ext.data.Model',
fields : [{
name : 'time',
mapping : 0
}, {
name : 'min',
mapping : 1
}, {
name : 'max',
mapping : 2
}]
});
// Use JSONP store for
// http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?
var store = Ext.create('Ext.data.Store', {
model : 'StockData',
proxy : {
type : 'jsonp',
url : 'http://www.highcharts.com/samples/data/jsonp.php?filename=range.json&callback=?',
reader : {
type : 'array'
}
},
autoLoad : false
});
var win = Ext.create('Ext.Window', {
width : 800,
height : 600,
minHeight : 400,
minWidth : 550,
hidden : false,
shadow : false,
maximizable : true,
title : 'Highstock example',
renderTo : Ext.getBody(),
layout : 'fit',
tbar : [{
text : 'Reload Data',
handler : function() {
store.load();
}
}],
items : [{
xtype : 'highstock',
id : 'chart',
series : [{
name : 'Temperatures',
plot: 'arearange',
getData: function(record) {
return [ record.data.time, record.data.min, record.data.max ];
}
}],
height : 500,
width : 700,
store : store,
chartConfig : {
chart : {
defaultSerieType: 'arearange',
marginLeft : 50,
marginRight : 50
},
credits : {
href : 'http://joekuan.wordpress.com',
text : 'Joe Kuan (joekuan.wordpress.com)',
style : {
color : '#898989'
}
},
rangeSelector : {
selected : 1
},
tooltip: {
valueSuffix: '°C'
},
title : {
text : 'Temperature'
}
}
}]
});
win.show();
store.load();
}
});
</script>
</head>
</head>
<body id="docbody">
</body> </html>