Rev | Line | |
---|
[7849] | 1 | package {
|
---|
| 2 | import com.serialization.json.JSON;
|
---|
| 3 |
|
---|
| 4 | /**
|
---|
| 5 | * A simple function to inspect the JSON for items
|
---|
| 6 | * before we build the chart
|
---|
| 7 | */
|
---|
| 8 | public class JsonInspector
|
---|
| 9 | {
|
---|
| 10 |
|
---|
| 11 | public static function has_pie_chart( json:Object ): Boolean
|
---|
| 12 | {
|
---|
| 13 |
|
---|
| 14 | var elements:Array = json['elements'] as Array;
|
---|
| 15 |
|
---|
| 16 | for( var i:Number = 0; i < elements.length; i++ )
|
---|
| 17 | {
|
---|
| 18 | // tr.ace( elements[i]['type'] );
|
---|
| 19 |
|
---|
| 20 | if ( elements[i]['type'] == 'pie' )
|
---|
| 21 | return true;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | return false;
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | public static function is_radar( json:Object ): Boolean
|
---|
| 28 | {
|
---|
| 29 |
|
---|
| 30 | if ( json['radar_axis'] != null )
|
---|
| 31 | return true;
|
---|
| 32 |
|
---|
| 33 | return false;
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.