Line | |
---|
1 | package elements.axis {
|
---|
2 | import string.Utils;
|
---|
3 |
|
---|
4 | public class YLabelStyle
|
---|
5 | {
|
---|
6 | public var style:Object;
|
---|
7 |
|
---|
8 | public function YLabelStyle( json:Object, name:String )
|
---|
9 | {
|
---|
10 |
|
---|
11 | this.style = { size: 10,
|
---|
12 | colour: 0x000000,
|
---|
13 | show_labels: true,
|
---|
14 | visible: true
|
---|
15 | };
|
---|
16 |
|
---|
17 | var comma:Number;
|
---|
18 | var none:Number;
|
---|
19 | var tmp:Array;
|
---|
20 |
|
---|
21 | if( json[name+'_label_style'] == undefined )
|
---|
22 | return;
|
---|
23 |
|
---|
24 | // is it CSV?
|
---|
25 | comma = json[name+'_label_style'].lastIndexOf(',');
|
---|
26 |
|
---|
27 | if( comma<0 )
|
---|
28 | {
|
---|
29 | none = json[name+'_label_style'].lastIndexOf('none',0);
|
---|
30 | if( none>-1 )
|
---|
31 | {
|
---|
32 | this.style.show_labels = false;
|
---|
33 | }
|
---|
34 | }
|
---|
35 | else
|
---|
36 | {
|
---|
37 | tmp = json[name+'_label_style'].split(',');
|
---|
38 | if( tmp.length > 0 )
|
---|
39 | this.style.size = tmp[0];
|
---|
40 |
|
---|
41 | if( tmp.length > 1 )
|
---|
42 | this.style.colour = Utils.get_colour(tmp[1]);
|
---|
43 | }
|
---|
44 | }
|
---|
45 | }
|
---|
46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.