瀏覽代碼

Optimize Float type be Number type

An An 3 年之前
父節點
當前提交
25dc5f7e34

+ 12 - 12
charts/src/main/java/com/github/aachartmodel/aainfographics/aaoptionsmodel/AAPane.kt

@@ -3,9 +3,9 @@ package com.github.aachartmodel.aainfographics.aaoptionsmodel
 class AAPane {
     var background: AABackground? = null
     var center: Array<Any>? = null
-    var endAngle: Float? = null
-    var size: Float? = null
-    var startAngle: Float? = null
+    var endAngle: Number? = null
+    var size: Number? = null
+    var startAngle: Number? = null
     fun background(prop: AABackground?): AAPane {
         background = prop
         return this
@@ -16,17 +16,17 @@ class AAPane {
         return this
     }
 
-    fun endAngle(prop: Float?): AAPane {
+    fun endAngle(prop: Number?): AAPane {
         endAngle = prop
         return this
     }
 
-    fun size(prop: Float?): AAPane {
+    fun size(prop: Number?): AAPane {
         size = prop
         return this
     }
 
-    fun startAngle(prop: Float?): AAPane {
+    fun startAngle(prop: Number?): AAPane {
         startAngle = prop
         return this
     }
@@ -35,10 +35,10 @@ class AAPane {
 class AABackground {
     var backgroundColor: Any? = null
     var borderColor: String? = null
-    var borderWidth: Float? = null
+    var borderWidth: Number? = null
     var className: String? = null
-    var innerRadius: Float? = null
-    var outerRadius: Float? = null
+    var innerRadius: Number? = null
+    var outerRadius: Number? = null
     var shape: String? = null
     fun backgroundColor(prop: Any?): AABackground {
         backgroundColor = prop
@@ -50,7 +50,7 @@ class AABackground {
         return this
     }
 
-    fun borderWidth(prop: Float?): AABackground {
+    fun borderWidth(prop: Number?): AABackground {
         borderWidth = prop
         return this
     }
@@ -60,12 +60,12 @@ class AABackground {
         return this
     }
 
-    fun innerRadius(prop: Float?): AABackground {
+    fun innerRadius(prop: Number?): AABackground {
         innerRadius = prop
         return this
     }
 
-    fun outerRadius(prop: Float?): AABackground {
+    fun outerRadius(prop: Number?): AABackground {
         outerRadius = prop
         return this
     }

+ 6 - 6
charts/src/main/java/com/github/aachartmodel/aainfographics/aaoptionsmodel/AAPlotBandsElement.kt

@@ -36,21 +36,21 @@
 package com.github.aachartmodel.aainfographics.aaoptionsmodel
 
 class AAPlotBandsElement {
-    private var from: Float? = null
-    private var to: Float? = null
+    private var from: Number? = null
+    private var to: Number? = null
     private var color: Any? = null
     private var borderColor: String? = null
-    private var borderWidth: Float? = null
+    private var borderWidth: Number? = null
     private var className: String? = null
     private var label: AALabel? = null
     private var index: Int? = null
 
-    fun from(prop: Float?): AAPlotBandsElement {
+    fun from(prop: Number?): AAPlotBandsElement {
         from = prop
         return this
     }
 
-    fun to(prop: Float?): AAPlotBandsElement {
+    fun to(prop: Number?): AAPlotBandsElement {
         to = prop
         return this
     }
@@ -66,7 +66,7 @@ class AAPlotBandsElement {
         return this
     }
 
-    fun borderWidth(prop: Float?): AAPlotBandsElement {
+    fun borderWidth(prop: Number?): AAPlotBandsElement {
         borderWidth = prop
         return this
     }

+ 4 - 4
charts/src/main/java/com/github/aachartmodel/aainfographics/aaoptionsmodel/AAPlotLinesElement.kt

@@ -42,8 +42,8 @@ class AAPlotLinesElement {
 
     private var color: Any? = null
     private var dashStyle: String? = null
-    private var width: Float? = null
-    private var value: Float? = null
+    private var width: Number? = null
+    private var value: Number? = null
     private var zIndex: Int? = null
     private var label: AALabel? = null
 
@@ -57,12 +57,12 @@ class AAPlotLinesElement {
         return this
     }
 
-    fun width(prop: Float?): AAPlotLinesElement {
+    fun width(prop: Number?): AAPlotLinesElement {
         width = prop
         return this
     }
 
-    fun value(prop: Float?): AAPlotLinesElement {
+    fun value(prop: Number?): AAPlotLinesElement {
         value = prop
         return this
     }

+ 24 - 24
charts/src/main/java/com/github/aachartmodel/aainfographics/aaoptionsmodel/AAPlotOptions.kt

@@ -86,13 +86,13 @@ class AAColumn {
         null//Padding between each column or bar, in x axis units. 默认是:0.1.
     var groupPadding: Float? =
         null//Padding between each value groups, in x axis units. 默认是:0.2.
-    var borderWidth: Float? = null
+    var borderWidth: Number? = null
     var colorByPoint: Boolean? =
         null//对每个不同的点设置颜色(当图表类型为 AAColumn 时,设置为 AAColumn 对象的属性,当图表类型为 bar 时,应该设置为 bar 对象的属性才有效)
     var dataLabels: AADataLabels? = null
     var stacking: String? = null
-    var borderRadius: Float? = null
-    var yAxis: Float? = null
+    var borderRadius: Number? = null
+    var yAxis: Int? = null
 
     fun name(prop: String): AAColumn {
         name = prop
@@ -129,7 +129,7 @@ class AAColumn {
         return this
     }
 
-    fun borderWidth(prop: Float?): AAColumn {
+    fun borderWidth(prop: Number?): AAColumn {
         borderWidth = prop
         return this
     }
@@ -149,12 +149,12 @@ class AAColumn {
         return this
     }
 
-    fun borderRadius(prop: Float?): AAColumn {
+    fun borderRadius(prop: Number?): AAColumn {
         borderRadius = prop
         return this
     }
 
-    fun yAxis(prop: Float?): AAColumn {
+    fun yAxis(prop: Int?): AAColumn {
         yAxis = prop
         return this
     }
@@ -173,13 +173,13 @@ class AABar {
         null//Padding between each column or bar, in x axis units. 默认是:0.1.
     var groupPadding: Float? =
         null//Padding between each value groups, in x axis units. 默认是:0.2.
-    var borderWidth: Float? = null
+    var borderWidth: Number? = null
     var colorByPoint: Boolean? =
         null//对每个不同的点设置颜色(当图表类型为 AABar 时,设置为 AABar 对象的属性,当图表类型为 bar 时,应该设置为 bar 对象的属性才有效)
     var dataLabels: AADataLabels? = null
     var stacking: String? = null
-    var borderRadius: Float? = null
-    var yAxis: Float? = null
+    var borderRadius: Number? = null
+    var yAxis: Int? = null
 
     fun name(prop: String): AABar {
         name = prop
@@ -216,7 +216,7 @@ class AABar {
         return this
     }
 
-    fun borderWidth(prop: Float?): AABar {
+    fun borderWidth(prop: Number?): AABar {
         borderWidth = prop
         return this
     }
@@ -236,12 +236,12 @@ class AABar {
         return this
     }
 
-    fun borderRadius(prop: Float?): AABar {
+    fun borderRadius(prop: Number?): AABar {
         borderRadius = prop
         return this
     }
 
-    fun yAxis(prop: Float?): AABar {
+    fun yAxis(prop: Int?): AABar {
         yAxis = prop
         return this
     }
@@ -287,13 +287,13 @@ class AAAreaspline {
 class AAPie {
     var type: String? = null
     var dataLabels: AADataLabels? = null
-    var size: Float? = null
+    var size: Number? = null
     var allowPointSelect: Boolean? = null
     var cursor: String? = null
     var showInLegend: Boolean? = null
-    var startAngle: Float? = null
-    var endAngle: Float? = null
-    var depth: Float? = null
+    var startAngle: Number? = null
+    var endAngle: Number? = null
+    var depth: Number? = null
     var center: Any? = null
     var data: Array<Any>? = null
 
@@ -308,7 +308,7 @@ class AAPie {
         return this
     }
 
-    fun size(prop: Float?): AAPie {
+    fun size(prop: Number?): AAPie {
         size = prop
         return this
     }
@@ -328,17 +328,17 @@ class AAPie {
         return this
     }
 
-    fun startAngle(prop: Float?): AAPie {
+    fun startAngle(prop: Number?): AAPie {
         startAngle = prop
         return this
     }
 
-    fun endAngle(prop: Float?): AAPie {
+    fun endAngle(prop: Number?): AAPie {
         endAngle = prop
         return this
     }
 
-    fun depth(prop: Float?): AAPie {
+    fun depth(prop: Number?): AAPie {
         depth = prop
         return this
     }
@@ -356,16 +356,16 @@ class AAPie {
 }
 
 class AAColumnrange {
-    var borderRadius: Float? = null
-    var borderWidth: Float? = null
+    var borderRadius: Number? = null
+    var borderWidth: Number? = null
     var dataLabels: AADataLabels? = null
 
-    fun borderRadius(prop: Float?): AAColumnrange {
+    fun borderRadius(prop: Number?): AAColumnrange {
         borderRadius = prop
         return this
     }
 
-    fun borderWidth(prop: Float?): AAColumnrange {
+    fun borderWidth(prop: Number?): AAColumnrange {
         borderWidth = prop
         return this
     }