AnalogCircleIndicator.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. define("dojox/gauges/AnalogCircleIndicator", ["dojo/_base/declare","./AnalogIndicatorBase"],
  2. function(declare, AnalogIndicatorBase) {
  3. /*=====
  4. AnalogIndicatorBase = dojox.gauges.AnalogIndicatorBase;
  5. =====*/
  6. return declare("dojox.gauges.AnalogCircleIndicator", [AnalogIndicatorBase], {
  7. // summary:
  8. // An indicator for the AnalogGauge that draws a circle. The center of the circle is positioned
  9. // on the circular gauge according to the value of the indicator. The circle has for radius the
  10. // length of the indicator. This indicator is mainly used to draw round ticks for the scale.
  11. _getShapes: function(group){
  12. // summary:
  13. // Override of dojox.gauges.AnalogLineIndicator._getShapes
  14. var color = this.color ? this.color : 'black';
  15. var strokeColor = this.strokeColor ? this.strokeColor : color;
  16. var stroke = {
  17. color: strokeColor,
  18. width: 1
  19. };
  20. if (this.color.type && !this.strokeColor){
  21. stroke.color = this.color.colors[0].color;
  22. }
  23. return [group.createCircle({
  24. cx: 0,
  25. cy: -this.offset,
  26. r: this.length
  27. }).setFill(color).setStroke(stroke)];
  28. }
  29. });
  30. });