Last change
on this file since 529 was
483,
checked in by hendrikvanantwerpen, 11 years ago
|
Added Dojo 1.9.3 release.
|
File size:
1.2 KB
|
Line | |
---|
1 | define(["dojo/_base/declare","dojox/gfx","./BarLineIndicator"], |
---|
2 | function(declare, gfx, BarLineIndicator) { |
---|
3 | |
---|
4 | return declare("dojox.gauges.BarCircleIndicator", [BarLineIndicator], { |
---|
5 | // summary: |
---|
6 | // An indicator for the BarGauge that draws a circle at a position that corresponds to the |
---|
7 | // indicator value. This indicator is mainly used to draw round ticks for the scale. |
---|
8 | |
---|
9 | _getShapes: function(group){ |
---|
10 | // summary: |
---|
11 | // Override of dojox.gauges.BarLineIndicator._getShapes |
---|
12 | var color = this.color ? this.color : 'black'; |
---|
13 | var strokeColor = this.strokeColor ? this.strokeColor : color; |
---|
14 | var stroke = { |
---|
15 | color: strokeColor, |
---|
16 | width: 1 |
---|
17 | }; |
---|
18 | if (this.color.type && !this.strokeColor){ |
---|
19 | stroke.color = this.color.colors[0].color; |
---|
20 | } |
---|
21 | var y = this._gauge.dataY + this.offset + this.length / 2; |
---|
22 | var v = this.value; |
---|
23 | if (v < this._gauge.min){ |
---|
24 | v = this._gauge.min; |
---|
25 | } |
---|
26 | if (v > this._gauge.max){ |
---|
27 | v = this._gauge.max; |
---|
28 | } |
---|
29 | var pos = this._gauge._getPosition(v); |
---|
30 | |
---|
31 | var shapes = [group.createCircle({ |
---|
32 | cx: 0, |
---|
33 | cy: y, |
---|
34 | r: this.length / 2 |
---|
35 | }).setFill(color).setStroke(stroke)]; |
---|
36 | |
---|
37 | shapes[0].setTransform(gfx.matrix.translate(pos, 0)); |
---|
38 | return shapes; |
---|
39 | } |
---|
40 | }); |
---|
41 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.