YAxisRight.as 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package elements.axis {
  2. import flash.display.Sprite;
  3. public class YAxisRight extends YAxisBase {
  4. function YAxisRight() {}
  5. public override function init(json:Object): void {
  6. this.labels = new YAxisLabelsRight(json);
  7. this.addChild( this.labels );
  8. //
  9. // default values for a right axis (turned off)
  10. //
  11. var style:Object = {
  12. stroke: 2,
  13. 'tick-length': 3,
  14. colour: '#784016',
  15. offset: false,
  16. 'grid-colour': '#F5E1AA',
  17. 'grid-visible': false, // <-- this is off by default for RIGHT axis
  18. '3d': 0,
  19. steps: 1,
  20. visible: false, // <-- by default this is invisible
  21. min: 0,
  22. max: 10
  23. };
  24. //
  25. // OK, the user has set the right Y axis,
  26. // but forgot to specifically set visible to
  27. // true, I think we can forgive them:
  28. //
  29. if( json.y_axis_right )
  30. style.visible = true;
  31. super._init(json, 'y_axis_right', style);
  32. }
  33. public override function resize( label_pos:Number, sc:ScreenCoords ):void {
  34. super.resize_helper( label_pos, sc, true);
  35. }
  36. }
  37. }