Gauge.js
2.47 KB
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
Ext.require(['Ext.chart.*', 'Ext.chart.axis.Gauge', 'Ext.chart.series.*', 'Ext.Window']);
Ext.onReady(function () {
Ext.create('Ext.Window', {
width: 800,
height: 250,
minWidth: 650,
minHeight: 225,
title: 'Gauge Charts',
tbar: [{
text: 'Reload Data',
handler: function() {
store1.loadData(generateData(1));
store3.loadData(generateData(1));
store4.loadData(generateData(1));
}
}],
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'chart',
style: 'background:#fff',
animate: {
easing: 'elasticIn',
duration: 1000
},
store: store1,
insetPadding: 25,
flex: 1,
axes: [{
type: 'gauge',
position: 'gauge',
minimum: 0,
maximum: 100,
steps: 10,
margin: -10
}],
series: [{
type: 'gauge',
field: 'data1',
donut: false,
colorSet: ['#F49D10', '#ddd']
}]
}, {
xtype: 'chart',
style: 'background:#fff',
animate: true,
store: store3,
insetPadding: 25,
flex: 1,
axes: [{
type: 'gauge',
position: 'gauge',
minimum: 0,
maximum: 100,
steps: 10,
margin: 7
}],
series: [{
type: 'gauge',
field: 'data1',
donut: 30,
colorSet: ['#82B525', '#ddd']
}]
}, {
xtype: 'chart',
style: 'background:#fff',
animate: {
easing: 'bounceOut',
duration: 500
},
store: store4,
insetPadding: 25,
flex: 1,
axes: [{
type: 'gauge',
position: 'gauge',
minimum: 0,
maximum: 100,
steps: 10,
margin: 7
}],
series: [{
type: 'gauge',
field: 'data1',
donut: 80,
colorSet: ['#3AA8CB', '#ddd']
}]
}]
}).show();
});