This is an automated email from the ASF dual-hosted git repository.

bigosmallm pushed a commit to branch feature/echarts
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/feature/echarts by this push:
     new 95fa114  Add support for PieChart (includes donut chart).  Add 
PieChartExample
95fa114 is described below

commit 95fa114ef73a7f929c8721f5679ba322e1398b61
Author: Om Muppirala <[email protected]>
AuthorDate: Wed Mar 28 01:09:14 2018 -0700

    Add support for PieChart (includes donut chart).  Add PieChartExample
---
 examples/royale/ECharts/src/PieChartExample.mxml |   3 +-
 examples/royale/ECharts/src/echarts/PieSeries.as | 102 +++++++++++++++++++++++
 examples/royale/ECharts/src/echarts/Series.as    |   1 +
 3 files changed, 105 insertions(+), 1 deletion(-)

diff --git a/examples/royale/ECharts/src/PieChartExample.mxml 
b/examples/royale/ECharts/src/PieChartExample.mxml
index 2311124..24c65bd 100644
--- a/examples/royale/ECharts/src/PieChartExample.mxml
+++ b/examples/royale/ECharts/src/PieChartExample.mxml
@@ -29,7 +29,8 @@
                         <ns2:seriesList>
                             <ns2:SeriesList>
                                 <ns2:series>
-                                    <ns2:Series name="Sales" type="pie" 
data="{this.salesData}" />
+                                    <ns2:PieSeries name="Sales" type="pie" 
data="{this.salesData}" startAngle="45" minAngle="45" clockwise="false" 
+                                                    center="{['50%','50%']}" 
radius="{['75%','25%']}" />
                                 </ns2:series>
                             </ns2:SeriesList>
                         </ns2:seriesList>
diff --git a/examples/royale/ECharts/src/echarts/PieSeries.as 
b/examples/royale/ECharts/src/echarts/PieSeries.as
new file mode 100644
index 0000000..db869ff
--- /dev/null
+++ b/examples/royale/ECharts/src/echarts/PieSeries.as
@@ -0,0 +1,102 @@
+package echarts
+{
+
+    public class PieSeries extends Series{
+               private var _clockwise:Boolean;
+               private var _startAngle:Number;
+               private var _minAngle:Number;
+               private var _roseType:String;
+               private var _radius:Array;
+               private var _center:Array;
+
+        [Bindable("seriesChanged")]
+               public function get clockwise():Boolean
+               {
+                       return _clockwise;
+               }
+
+               public function set clockwise(value:Boolean):void
+               {
+                       _clockwise = value;
+            dispatchEvent(new Event("seriesChanged"));
+               }
+
+               [Bindable("seriesChanged")]
+               public function get startAngle():Number
+               {
+                       return _startAngle;
+               }
+        
+               public function set startAngle(value:Number):void
+               {
+                       _startAngle = value;
+                       dispatchEvent(new Event("seriesChanged"));
+               }
+
+               [Bindable("seriesChanged")]
+               public function get minAngle():Number
+               {
+                       return _minAngle;
+               }
+        
+               public function set minAngle(value:Number):void
+               {
+                       _minAngle = value;
+                       dispatchEvent(new Event("seriesChanged"));
+               }
+
+               [Bindable("seriesChanged")]
+               public function get roseType():String
+               {
+                       return _roseType;
+               }
+
+               public function set roseType(value:String):void
+               {
+                       _roseType = value;
+            dispatchEvent(new Event("seriesChanged"));
+               }
+
+               [Bindable("seriesChanged")]
+               public function get radius():Array
+               {
+                       return _radius;
+               }
+
+               public function set radius(value:Array):void
+               {
+                       _radius = value;
+            dispatchEvent(new Event("seriesChanged"));
+               }
+
+               [Bindable("seriesChanged")]
+               public function get center():Array
+               {
+                       return _center;
+               }
+
+               public function set center(value:Array):void
+               {
+                       _center = value;
+            dispatchEvent(new Event("seriesChanged"));
+               }
+
+        override public function get obj():Object {
+                       //Combine attributes from superclass with this class's 
attributes
+                       var obj:Object = super.obj;
+            var thisObj:Object = {
+                               clockwise: this.clockwise,
+                startAngle: this.startAngle,
+                minAngle: this.minAngle,
+                               roseType:this.roseType,
+                               radius:this.radius,
+                               center:this.center
+                       };
+                       for (var attrname:String in thisObj) 
+                       { 
+                               obj[attrname] = thisObj[attrname]; 
+                       }
+                       return obj;
+        }
+    }
+}
\ No newline at end of file
diff --git a/examples/royale/ECharts/src/echarts/Series.as 
b/examples/royale/ECharts/src/echarts/Series.as
index 8640a54..5669b88 100644
--- a/examples/royale/ECharts/src/echarts/Series.as
+++ b/examples/royale/ECharts/src/echarts/Series.as
@@ -28,6 +28,7 @@ package echarts
                public function set name(value:String):void
                {
                        _name = value;
+                       dispatchEvent(new Event("seriesChanged"));
                }
 
                [Bindable("seriesChanged")]

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to