Переглянути джерело

Add more useful charts samples

An An 3 роки тому
батько
коміт
9bf15474c8

+ 6 - 2
sample/src/main/java/com/github/aachartmodel/aainfographics/demo/basiccontent/MainActivity.kt

@@ -43,7 +43,9 @@ class MainActivity : AppCompatActivity() {
                 "scatterMixedLine",
                 "negativeColorMixedBubble",
                 "polygonMixedScatter",
-                "polarChartMixed"
+                "polarChartMixed",
+                "configurePieMixedLineMixedColumnChart",
+                "configureNegativeColorMixedAreasplineChart",
             ), arrayOf(
                 "colorfulChart",
                 "gradientColorfulChart",
@@ -190,7 +192,9 @@ class MainActivity : AppCompatActivity() {
                 "scatterMixedLine",
                 "negativeColorMixedBubble",
                 "polygonMixedScatter",
-                "polarChartMixed"
+                "polarChartMixed",
+                "configurePieMixedLineMixedColumnChart",
+                "configureNegativeColorMixedAreasplineChart",
             ), arrayOf(
                 /*自定义样式图表*/
                 "colorfulChart",

+ 2 - 0
sample/src/main/java/com/github/aachartmodel/aainfographics/demo/basiccontent/MixedChartActivity.kt

@@ -65,6 +65,8 @@ class MixedChartActivity : AppCompatActivity() {
             "negativeColorMixedBubble" -> return MixedChartComposer.negativeColorMixedBubble()
             "polygonMixedScatter" -> return MixedChartComposer.polygonMixedScatter()
             "polarChartMixed" -> return MixedChartComposer.polarChartMixedChart()
+            "configurePieMixedLineMixedColumnChart" -> return MixedChartComposer.configurePieMixedLineMixedColumnChart()
+            "configureNegativeColorMixedAreasplineChart" -> return MixedChartComposer.configureNegativeColorMixedAreasplineChart()
         }
         return MixedChartComposer.arearangeMixedLine()
     }

+ 4 - 4
sample/src/main/java/com/github/aachartmodel/aainfographics/demo/chartcomposer/MixedChartComposer.kt

@@ -34,7 +34,7 @@ import java.util.*
 
 object MixedChartComposer {
 
-     fun arearangeMixedLine(): AAChartModel {
+    fun arearangeMixedLine(): AAChartModel {
         return AAChartModel()
             .title("LANGUAGE MARKET SHARES JANUARY,2020 TO MAY")
             .subtitle("virtual data")
@@ -600,7 +600,7 @@ object MixedChartComposer {
             ))
     }
 
-    fun configurePieMixedLineMixedColumnChart(): AAChartModel? {
+    fun configurePieMixedLineMixedColumnChart(): AAChartModel {
         val columnElement1 = AASeriesElement()
             .name("Anna")
             .type(AAChartType.Column)
@@ -659,13 +659,13 @@ object MixedChartComposer {
                 columnElement2,
                 columnElement3,
                 lineElement,
-                pieElement as AASeriesElement
+                pieElement
             ))
     }
 
 
     //GitHub issue https://github.com/AAChartModel/AAChartKit/issues/921
-    private fun configureNegativeColorMixedAreasplineChart(): AAChartModel? {
+    fun configureNegativeColorMixedAreasplineChart(): AAChartModel {
         val blueStopsArr: Array<Any> = arrayOf(
             arrayOf(0.0, AARgba(30, 144, 255, 0.0f)),
             arrayOf(0.5, AARgba(30, 144, 255, 0.0f)),