Debian Codegraph @

dojox/gauges/tests/test_AnalogGauge-AMD.html

raw symbols SCIP
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>Dojo Gauges</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6 </head>
7 <style>
8 html {
9 height: 100%;
10 }
11
12 body {
13 margin: 0;
14 background-repeat: no-repeat;
15 background: #003366;
16 /* gecko based browsers */
17 background: -moz-linear-gradient(top, #003366, #000000);
18
19 /* webkit based browsers */
20 background: -webkit-gradient(linear, left top, left bottom, from(#003366), to(#000000));
21 }
22
23 .footer {
24 position:absolute;
25 bottom:0;
26 }
27
28
29 </style>
30 <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="parseOnLoad: 1, async:1"></script>
31 <script language="JavaScript" type="text/javascript">
32 require(['dojo/_base/lang', 'dojo/dom', 'dojo/_base/connect', 'dojox/gauges/AnalogGauge',
33 'dojox/gauges/AnalogArcIndicator', 'dojox/gauges/AnalogNeedleIndicator',
34 'dojox/gauges/AnalogCircleIndicator', 'dojox/gauges/TextIndicator',
35 'dojo/domReady', 'dojo/parser'], function(lang, dom, connect, AnalogGauge,
36 AnalogArcIndicator, AnalogNeedleIndicator, AnalogCircleIndicator, TextIndicator){
37
38 var gauge = new AnalogGauge({
39
40 background: [200, 200, 200, 0],
41 id: "gauge",
42 width: 250,
43 height: 200,
44 cx: 125,
45 cy: 150,
46 radius: 125,
47 useTooltip:false,
48 ranges: [{
49 low: 0,
50 high: 100,
51 color: 'black'
52 }],
53
54 majorTicks: {
55 offset: 90,
56 interval: 10,
57 length: 3,
58 color: 'white'
59 },
60
61 indicators: [new AnalogArcIndicator({
62 value: 100,
63 width: 30,
64 offset: 60,
65 color: 'white',
66 noChange: true,
67 title: 'value',
68 hideValue: true
69 }), new AnalogArcIndicator({
70 interactionMode: "gauge",
71 value: 20,
72 width: 20,
73 offset: 65,
74 color: 'gray',
75 noChange: false,
76 title: 'value',
77 hideValue: true
78 }), new TextIndicator({
79 value: 20,
80 align: 'middle',
81 x: 125,
82 y: 135,
83 font: {
84 family: "Arial",
85 style: "normal",
86 variant: 'small-caps',
87 weight: 'bold',
88 size: "30px"
89 },
90 hideValue: false,
91 color: 'gray'
92 })]
93 }, dom.byId("g1"));
94
95 gauge.startup();
96
97 connect.connect(gauge.indicators[1], "valueChanged", lang.hitch(gauge, function(){
98 this.indicators[2].update(this.indicators[1].value);
99 }));
100
101
102 gauge = new AnalogGauge({
103 id: "gauge2",
104 startAngle: 0,
105 endAngle: 270,
106 background: [0, 0, 0, 0],
107 id: "defaultGauge",
108 width: 250,
109 height: 250,
110 cx: 127,
111 cy: 125,
112 useTooltip:false,
113 radius: 125,
114 ranges: [{
115 low: 0,
116 high: 100,
117 color: [0, 0, 0, 0]
118 }],
119
120 majorTicks: {
121 offset: 95,
122 interval: 20,
123 length: 3,
124 color: 'white',
125 labelPlacement: 'outside'
126 },
127
128 indicators: [new AnalogArcIndicator({
129 value: 1000,
130 width: 30,
131 offset: 65,
132 strokeColor: 'black',
133 color: 'white',
134 noChange: true,
135 title: 'value',
136 hideValue: true
137 }), new AnalogArcIndicator({
138 value: 20,
139 width: 20,
140 offset: 70,
141 interactionMode: "gauge",
142 color: [122, 103, 140],
143 noChange: false,
144 title: 'value',
145 hideValue: true
146 }), new TextIndicator({
147 value: 20,
148 align: 'middle',
149 x: 125,
150 y: 140,
151 font: {
152 family: "Arial",
153 style: "normal",
154 variant: 'small-caps',
155 weight: 'bold',
156 size: "40px"
157 },
158 hideValue: false,
159 color: 'gray'
160 })]
161 }, dom.byId("g2"));
162
163 gauge.startup();
164
165 connect.connect(gauge.indicators[1], "valueChanged", lang.hitch(gauge, function(){
166 this.indicators[2].update(this.indicators[1].value);
167 }));
168
169
170 gauge = new AnalogGauge({
171 id: "gauge3",
172 startAngle: -30,
173 endAngle: 30,
174 background: [0, 0, 0, 0],
175 width: 200,
176 height: 180,
177 cx: 100,
178 cy: 150,
179 radius: 130,
180 ranges: [{
181 low: -30,
182 high: 30,
183 color: [0, 0, 0, 0]
184 }],
185 useTooltip:false,
186 majorTicks: {
187 offset: 100,
188 interval: 10,
189 length: 3,
190 color: 'white',
191 labelPlacement: 'outside'
192 },
193
194 indicators: [new AnalogNeedleIndicator({
195 interactionMode: "gauge",
196 value: 0,
197 width: 10,
198 length: 100,
199 strokeColor: [100, 100, 100],
200 color: [200, 200, 200]
201 })]
202 }, dom.byId("g3"));
203
204 gauge.startup();
205
206
207 gauge = new AnalogGauge({
208 id: "gauge4",
209 startAngle: 20,
210 endAngle: 20,
211 background: [0, 0, 0, 0],
212 width: 200,
213 height: 200,
214 cx: 100,
215 cy: 100,
216 radius: 95,
217 useTooltip:false,
218 ranges: [{
219 low: 0,
220 high: 8,
221 color: [50, 90, 102]
222 }],
223
224 majorTicks: {
225 offset: 70,
226 interval: 1,
227 length: 3,
228 color: 'white',
229 labelPlacement: 'outside'
230 },
231
232 indicators: [new AnalogCircleIndicator({
233 interactionMode: "gauge",
234 offset: 45,
235 value: 5,
236 length: 10,
237 strokeColor: [163, 43, 38],
238 color: [222, 161, 64]
239
240 }), new AnalogArcIndicator({
241 value: 7,
242 width: 10,
243 offset: 60,
244
245 color: [255, 248, 178],
246 noChange: true,
247 title: 'value',
248 hideValue: true
249 })]
250 }, dom.byId("g4"));
251
252 gauge.startup();
253
254 })
255 </script>
256 <body>
257 <h2 align='center' style='color:gray;'>Analog Gauges</h2>
258 <table style='height:100%; width:100%'>
259 <tr style='height:20'>
260 <td align='center'>
261 <div id="g1">
262 </div>
263 </td>
264 <td align='center'>
265 <div id="g2">
266 </td>
267 </tr>
268 <tr style='height:20'>
269 <td align='center'>
270 <div id="g3">
271 </div>
272 </td>
273 <td align='center'>
274 <div id="g4">
275 </div>
276 </td>
277 </tr>
278 </table>
279 <div class='footer'>
280 <p style='color:gray; font-size:'xx-small'>Click a gauge to change its value.</p>
281 </div>
282 </div>
283 </body>
284 </html>