Pārlūkot izejas kodu

Fix #61 => Support turning off animation effects

An An 3 gadi atpakaļ
vecāks
revīzija
bd74967156

+ 2 - 2
charts/src/main/java/com/github/aachartmodel/aainfographics/aaoptionsmodel/AAChart.kt

@@ -19,7 +19,7 @@ class AAChart {
     var panning: Boolean? = null
     var panKey: String? = null
     var polar: Boolean? = null
-    var animation: AAAnimation? = null
+    var animation: Any? = null //AAAnimation | Boolean
     var inverted: Boolean? = null
 
     /*图表外边缘和绘图区域之间的边距。 数组中的数字分别表示顶部,右侧,底部和左侧 ([👆,👉,👇,👈])。
@@ -68,7 +68,7 @@ class AAChart {
         return this
     }
 
-    fun animation(prop: AAAnimation): AAChart {
+    fun animation(prop: Any): AAChart {
         animation = prop
         return this
     }

+ 3 - 0
sample/src/main/java/com/github/aachartmodel/aainfographics/demo/chartcomposer/ChartOptionsComposer.kt

@@ -74,6 +74,9 @@ object ChartOptionsComposer {
 
         val aaOptions = aaChartModel.aa_toAAOptions()
 
+        //https://github.com/AAChartModel/AAChartCore-Kotlin/issues/61
+        aaOptions.chart?.animation = false //turn off animation
+
         aaOptions.yAxis?.labels?.format = "{value} %"//给y轴添加单位
 
         aaOptions.xAxis?.apply {