Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
1.7 KB
|
Line | |
---|
1 | define(["dojo/_base/declare","dijit/_Widget"], |
---|
2 | function(declare, Widget) { |
---|
3 | |
---|
4 | /*===== |
---|
5 | Widget = dijit._Widget; |
---|
6 | =====*/ |
---|
7 | |
---|
8 | return declare("dojox.gauges.Range", [Widget], { |
---|
9 | // summary: |
---|
10 | // a range to be used in a _Gauge |
---|
11 | // |
---|
12 | // description: |
---|
13 | // a range widget, which has given properties. drawn by a _Gauge. |
---|
14 | // |
---|
15 | // example: |
---|
16 | // | <script type="text/javascript"> |
---|
17 | // | require(["dojox/gauges/AnalogGauge"]); |
---|
18 | // | </script> |
---|
19 | // | ... |
---|
20 | // | <div dojoType="dojox.gauges.AnalogGauge" |
---|
21 | // | id="testGauge" |
---|
22 | // | width="300" |
---|
23 | // | height="200" |
---|
24 | // | cx=150 |
---|
25 | // | cy=175 |
---|
26 | // | radius=125 |
---|
27 | // | image="gaugeOverlay.png" |
---|
28 | // | imageOverlay="false" |
---|
29 | // | imageWidth="280" |
---|
30 | // | imageHeight="155" |
---|
31 | // | imageX="12" |
---|
32 | // | imageY="38"> |
---|
33 | // | <div dojoType="dojox.gauges.Range" |
---|
34 | // | low=5 |
---|
35 | // | high=10 |
---|
36 | // | hover="5 - 10" |
---|
37 | // | ></div> |
---|
38 | // | <div dojoType="dojox.gauges.Range" |
---|
39 | // | low=10 |
---|
40 | // | high=20 |
---|
41 | // | hover="10 - 20" |
---|
42 | // | ></div> |
---|
43 | // | </div> |
---|
44 | |
---|
45 | // low: Number |
---|
46 | // the low value of the range |
---|
47 | low: 0, |
---|
48 | |
---|
49 | // high: Number |
---|
50 | // the high value of the range |
---|
51 | high: 0, |
---|
52 | |
---|
53 | // hover: String |
---|
54 | // the text to put in the tooltip for the gauge |
---|
55 | hover: '', |
---|
56 | |
---|
57 | // color: Object |
---|
58 | // the color of the range. This must be an object of one of two forms: |
---|
59 | // {'color': 'color-name'} |
---|
60 | // OR |
---|
61 | // (for a gradient:) |
---|
62 | // {'type': 'linear', 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] } |
---|
63 | color: null, |
---|
64 | |
---|
65 | // size: Number |
---|
66 | // for a circular gauge (such as an AnalogGauge), this dictates the size of the arc |
---|
67 | size: 0, |
---|
68 | |
---|
69 | startup: function(){ |
---|
70 | this.color = this.color ? ( this.color.color || this.color) : 'black'; |
---|
71 | } |
---|
72 | }); |
---|
73 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.