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