Range.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. define("dojox/gauges/Range", ["dojo/_base/declare","dijit/_Widget"],
  2. function(declare, Widget) {
  3. /*=====
  4. Widget = dijit._Widget;
  5. =====*/
  6. return declare("dojox.gauges.Range", [Widget], {
  7. // summary:
  8. // a range to be used in a _Gauge
  9. //
  10. // description:
  11. // a range widget, which has given properties. drawn by a _Gauge.
  12. //
  13. // example:
  14. // | <script type="text/javascript">
  15. // | require(["dojox/gauges/AnalogGauge"]);
  16. // | </script>
  17. // | ...
  18. // | <div dojoType="dojox.gauges.AnalogGauge"
  19. // | id="testGauge"
  20. // | width="300"
  21. // | height="200"
  22. // | cx=150
  23. // | cy=175
  24. // | radius=125
  25. // | image="gaugeOverlay.png"
  26. // | imageOverlay="false"
  27. // | imageWidth="280"
  28. // | imageHeight="155"
  29. // | imageX="12"
  30. // | imageY="38">
  31. // | <div dojoType="dojox.gauges.Range"
  32. // | low=5
  33. // | high=10
  34. // | hover="5 - 10"
  35. // | ></div>
  36. // | <div dojoType="dojox.gauges.Range"
  37. // | low=10
  38. // | high=20
  39. // | hover="10 - 20"
  40. // | ></div>
  41. // | </div>
  42. // low: Number
  43. // the low value of the range
  44. low: 0,
  45. // high: Number
  46. // the high value of the range
  47. high: 0,
  48. // hover: String
  49. // the text to put in the tooltip for the gauge
  50. hover: '',
  51. // color: Object
  52. // the color of the range. This must be an object of one of two forms:
  53. // {'color': 'color-name'}
  54. // OR
  55. // (for a gradient:)
  56. // {'type': 'linear', 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] }
  57. color: null,
  58. // size: Number
  59. // for a circular gauge (such as an AnalogGauge), this dictates the size of the arc
  60. size: 0,
  61. startup: function(){
  62. this.color = this.color ? ( this.color.color || this.color) : 'black';
  63. }
  64. });
  65. });