Browse Source

Add more useful charts samples

An An 4 years ago
parent
commit
848e3705d4

+ 5 - 0
app/src/main/java/com/aachartmodel/aainfographics/AAInfographicsLib/AAChartCreator/AAChartModel.kt

@@ -327,6 +327,11 @@ class AAChartModel {
         return this
     }
 
+    fun tooltipValueSuffix(prop: String?): AAChartModel {
+        tooltipValueSuffix = prop
+        return this
+    }
+
     fun tooltipCrosshairs(prop: Boolean?): AAChartModel {
         tooltipCrosshairs = prop
         return this

+ 66 - 22
app/src/main/java/com/aachartmodel/aainfographics/AAInfographicsLib/AAChartCreator/AASeriesElement.kt

@@ -40,22 +40,29 @@ import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.AAToolti
 class AASeriesElement {
 
     private var type: String? = null
+    private var allowPointSelect: Boolean? = null
     private var name: String? = null
     private var data: Array<Any>? = null
-    private var lineWidth: Float? = null//折线图、曲线图、直方折线图、折线填充图、曲线填充图、直方折线填充图的线条宽度
+    private var lineWidth //折线图、曲线图、直方折线图、折线填充图、曲线填充图、直方折线填充图的线条宽度
+            : Float? = null
     private var borderWidth: Float? = null
     private var color: Any? = null
     private var fillColor: Any? = null
-    private var fillOpacity: Float? = null//折线填充图、曲线填充图、直方折线填充图等填充图类型的填充颜色透明度
-    private var threshold: Float? =
-        null//The threshold, also called zero level or base level. For line type series this is only used in conjunction with negativeColor. default:0.
-    private var negativeColor: String? =
-        null// The color for the parts of the graph or points that are below the threshold
+    private var fillOpacity //折线填充图、曲线填充图、直方折线填充图等填充图类型的填充颜色透明度
+            : Float? = null
+    private var threshold //The threshold, also called zero level or base level. For line type series this is only used in conjunction with negativeColor. default:0.
+            : Float? = null
+    private var negativeColor // The color for the parts of the graph or points that are below the threshold
+            : String? = null
+    private var negativeFillColor: Any? = null
+    private var size: Any? = null
+    private var innerSize: Any? = null
     private var dashStyle: String? = null
     private var yAxis: Int? = null
     private var dataLabels: AADataLabels? = null
     private var marker: AAMarker? = null
     private var step: Any? = null
+    private var states: Any? = null
     private var colorByPoint: Boolean? = null
     private var zIndex: Int? = null
     private var zones: Array<Any>? = null
@@ -63,14 +70,21 @@ class AASeriesElement {
     private var stack: String? = null
     private var tooltip: AATooltip? = null
     private var showInLegend: Boolean? = null
+    private var enableMouseTracking: Boolean? = null
+    private var reversed: Boolean? = null
 
 
-    fun type(prop: AAChartType): AASeriesElement {
-        type = prop.value
+    fun type(prop: String?): AASeriesElement {
+        type = prop
         return this
     }
 
-    fun name(prop: String): AASeriesElement {
+    fun allowPointSelect(prop: Boolean?): AASeriesElement {
+        allowPointSelect = prop
+        return this
+    }
+
+    fun name(prop: String?): AASeriesElement {
         name = prop
         return this
     }
@@ -85,17 +99,17 @@ class AASeriesElement {
         return this
     }
 
-    fun borderWidth(prop: Float): AASeriesElement {
+    fun borderWidth(prop: Float?): AASeriesElement {
         borderWidth = prop
         return this
     }
 
-    fun color(prop: Any): AASeriesElement {
+    fun color(prop: Any?): AASeriesElement {
         color = prop
         return this
     }
 
-    fun fillColor(prop: Any): AASeriesElement {
+    fun fillColor(prop: Any?): AASeriesElement {
         fillColor = prop
         return this
     }
@@ -110,13 +124,28 @@ class AASeriesElement {
         return this
     }
 
-    fun negativeColor(prop: String): AASeriesElement {
+    fun negativeColor(prop: String?): AASeriesElement {
         negativeColor = prop
         return this
     }
 
-    fun dashStyle(prop: AAChartLineDashStyleType): AASeriesElement {
-        dashStyle = prop.value
+    fun negativeFillColor(prop: Any?): AASeriesElement {
+        negativeFillColor = prop
+        return this
+    }
+
+    fun size(prop: Any?): AASeriesElement {
+        size = prop
+        return this
+    }
+
+    fun innerSize(prop: Any?): AASeriesElement {
+        innerSize = prop
+        return this
+    }
+
+    fun dashStyle(prop: String?): AASeriesElement {
+        dashStyle = prop
         return this
     }
 
@@ -125,21 +154,26 @@ class AASeriesElement {
         return this
     }
 
-    fun dataLabels(prop: AADataLabels): AASeriesElement {
+    fun dataLabels(prop: AADataLabels?): AASeriesElement {
         dataLabels = prop
         return this
     }
 
-    fun marker(prop: AAMarker): AASeriesElement {
+    fun marker(prop: AAMarker?): AASeriesElement {
         marker = prop
         return this
     }
 
-    fun step(prop: Any): AASeriesElement {
+    fun step(prop: Any?): AASeriesElement {
         step = prop
         return this
     }
 
+    fun states(prop: Any?): AASeriesElement {
+        states = prop
+        return this
+    }
+
     fun colorByPoint(prop: Boolean?): AASeriesElement {
         colorByPoint = prop
         return this
@@ -155,26 +189,36 @@ class AASeriesElement {
         return this
     }
 
-    fun shadow(prop: AAShadow): AASeriesElement {
+    fun shadow(prop: AAShadow?): AASeriesElement {
         shadow = prop
         return this
     }
 
-    fun stack(prop: String): AASeriesElement {
+    fun stack(prop: String?): AASeriesElement {
         stack = prop
         return this
     }
 
-    fun tooltip(prop: AATooltip): AASeriesElement {
+    fun tooltip(prop: AATooltip?): AASeriesElement {
         tooltip = prop
         return this
     }
 
-    fun showInLegend(prop: Boolean): AASeriesElement? {
+    fun showInLegend(prop: Boolean?): AASeriesElement {
         showInLegend = prop
         return this
     }
 
+    fun enableMouseTracking(prop: Boolean?): AASeriesElement {
+        enableMouseTracking = prop
+        return this
+    }
+
+    fun reversed(prop: Boolean?): AASeriesElement {
+        reversed = prop
+        return this
+    }
+
 }
 
 

+ 47 - 9
app/src/main/java/com/aachartmodel/aainfographics/AAInfographicsLib/AAOptionsModel/AADataLabels.kt

@@ -8,10 +8,12 @@
  */
 package com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel
 
+import com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.AAChartAlignType
 import com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.AAChartVerticalAlignType
 
 class AADataLabels {
     var enabled: Boolean? = null
+    var align: String? = null
     var inside: Boolean? = null
     var style: AAStyle? = null
     var format: String? = null
@@ -28,23 +30,34 @@ class AADataLabels {
     var borderRadius: Float? = null
     var borderWidth: Float? = null
     var shape: String? = null
+    var crop: Boolean? = null
+    var overflow: String? = null
+    var softConnector: Boolean? = null
+    var textPath: Any? = null
+    var filter: Any? = null
 
     fun enabled(prop: Boolean?): AADataLabels {
         enabled = prop
         return this
     }
 
-    fun inside(prop: Boolean): AADataLabels {
+    fun align(prop: AAChartAlignType?): AADataLabels {
+        align = prop?.value
+        return this
+    }
+
+    fun inside(prop: Boolean?): AADataLabels {
         inside = prop
         return this
     }
 
-    fun style(prop: AAStyle): AADataLabels {
+
+    fun style(prop: AAStyle?): AADataLabels {
         style = prop
         return this
     }
 
-    fun format(prop: String): AADataLabels {
+    fun format(prop: String?): AADataLabels {
         format = prop
         return this
     }
@@ -69,8 +82,8 @@ class AADataLabels {
         return this
     }
 
-    fun verticalAlign(prop: AAChartVerticalAlignType): AADataLabels {
-        verticalAlign = prop.value
+    fun verticalAlign(prop: AAChartVerticalAlignType?): AADataLabels {
+        verticalAlign = prop?.value
         return this
     }
 
@@ -84,17 +97,17 @@ class AADataLabels {
         return this
     }
 
-    fun color(prop: String): AADataLabels {
+    fun color(prop: String?): AADataLabels {
         color = prop
         return this
     }
 
-    fun backgroundColor(prop: String): AADataLabels {
+    fun backgroundColor(prop: String?): AADataLabels {
         backgroundColor = prop
         return this
     }
 
-    fun borderColor(prop: String): AADataLabels {
+    fun borderColor(prop: String?): AADataLabels {
         borderColor = prop
         return this
     }
@@ -109,8 +122,33 @@ class AADataLabels {
         return this
     }
 
-    fun shape(prop: String): AADataLabels {
+    fun shape(prop: String?): AADataLabels {
         shape = prop
         return this
     }
+
+    fun crop(prop: Boolean?): AADataLabels {
+        crop = prop
+        return this
+    }
+
+    fun overflow(prop: String?): AADataLabels {
+        overflow = prop
+        return this
+    }
+
+    fun softConnector(prop: Boolean?): AADataLabels {
+        softConnector = prop
+        return this
+    }
+
+    fun textPath(prop: Any?): AADataLabels {
+        textPath = prop
+        return this
+    }
+
+    fun filter(prop: Any?): AADataLabels {
+        filter = prop
+        return this
+    }
 }

+ 61 - 0
app/src/main/java/com/aachartmodel/aainfographics/AAInfographicsLib/AAOptionsModel/AAMarker.kt

@@ -14,6 +14,7 @@ class AAMarker {
     private var fillColor: String? = null//点的填充色(用来设置折线连接点的填充色)
     private var lineWidth: Float? = null//外沿线的宽度(用来设置折线连接点的轮廓描边的宽度)
     private var lineColor: Any? = null//外沿线的颜色(用来设置折线连接点的轮廓描边颜色,当值为空字符串时,默认取数据点或数据列的颜色。)
+    private var states: AAMarkerStates? = null
 
 
     fun radius(prop: Float?): AAMarker {
@@ -41,4 +42,64 @@ class AAMarker {
         return this
     }
 
+    fun states(prop: AAMarkerStates): AAMarker? {
+        states = prop
+        return this
+    }
+}
+
+class AAMarkerStates {
+    var hover: AAMarkerHover? = null
+
+    fun hover(prop: AAMarkerHover?): AAMarkerStates {
+        hover = prop
+        return this
+    }
+}
+
+class AAMarkerHover {
+    var enabled: Boolean? = null
+    var fillColor: String? = null
+    var lineColor: String? = null
+    var lineWidth: Float? = null
+    var lineWidthPlus: Float? = null
+    var radius: Float? = null
+    var radiusPlus: Float? = null
+
+
+    fun enabled(prop: Boolean?): AAMarkerHover {
+        enabled = prop
+        return this
+    }
+
+    fun fillColor(prop: String?): AAMarkerHover {
+        fillColor = prop
+        return this
+    }
+
+    fun lineColor(prop: String?): AAMarkerHover {
+        lineColor = prop
+        return this
+    }
+
+    fun lineWidth(prop: Float?): AAMarkerHover {
+        lineWidth = prop
+        return this
+    }
+
+    fun lineWidthPlus(prop: Float?): AAMarkerHover {
+        lineWidthPlus = prop
+        return this
+    }
+
+    fun radius(prop: Float?): AAMarkerHover {
+        radius = prop
+        return this
+    }
+
+    fun radiusPlus(prop: Float?): AAMarkerHover {
+        radiusPlus = prop
+        return this
+    }
 }
+

+ 18 - 2
app/src/main/java/com/aachartmodel/aainfographics/AAInfographicsLib/AAOptionsModel/AAPlotOptions.kt

@@ -8,6 +8,9 @@
  */
 package com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel
 
+import com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.AAChartType
+import com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.AASeriesElement
+
 class AAPlotOptions {
     var column: AAColumn? = null
     var bar: AABar? = null
@@ -283,6 +286,7 @@ class AAAreaspline {
 }
 
 class AAPie {
+    var type:String? = null
     var dataLabels:AADataLabels? = null
     var size: Float? = null
     var allowPointSelect: Boolean? = null
@@ -291,7 +295,14 @@ class AAPie {
     var startAngle: Float? = null
     var endAngle: Float? = null
     var depth: Float? = null
-    var center: Float? = null
+    var center: Any? = null
+    var data: Array<Any>? = null
+
+
+    fun type(prop: AAChartType?): AAPie {
+        type = prop?.value
+        return this
+    }
 
     fun dataLabels(prop: AADataLabels): AAPie {
         dataLabels = prop
@@ -333,11 +344,16 @@ class AAPie {
         return this
     }
 
-    fun center(prop: Float?): AAPie {
+    fun center(prop: Any?): AAPie {
         center = prop
         return this
     }
 
+    fun data(prop: Array<Any>): AAPie {
+        data = prop
+        return this
+    }
+
 }
 
 class AAColumnrange {

+ 582 - 1
app/src/main/java/com/aachartmodel/aainfographics/ChartsDemo/ChartComposer/CustomStyleChartComposer.kt

@@ -27,8 +27,10 @@
  */
 package com.aachartmodel.aainfographics.ChartsDemo.ChartComposer
 
-import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.AAMarker
 import com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.*
+import com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.AAShadow
+import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.*
+import java.util.*
 
 class CustomStyleChartComposer  {
 
@@ -594,6 +596,585 @@ class CustomStyleChartComposer  {
                 )
         }
 
+
+        fun adjustYAxisMaxAndMinValues(): AAChartModel {
+            val categoriesArr = arrayOf(
+                "孤岛危机",
+                "使命召唤",
+                "荣誉勋章",
+                "狙击精英",
+                "神秘海域",
+                "最后生还者",
+                "巫师3狂猎",
+                "对马之魂",
+                "蝙蝠侠阿甘骑士",
+                "地狱边境",
+                "闪客",
+                "忍者之印"
+            )
+            return AAChartModel()
+                .chartType(AAChartType.Areaspline)
+                .legendEnabled(false)
+                .yAxisVisible(true)
+                .markerRadius(6f)
+                .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)
+                .zoomType(AAChartZoomType.XY)
+                .categories(categoriesArr)
+                .yAxisMin(2.0f)
+                .yAxisMax(45.4f)
+                .xAxisTickInterval(2)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("体重")
+                            .color("#2494F3")
+                            .data(arrayOf(7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6))
+                    )
+                )
+        }
+
+        fun customSpecialStyleDataLabelOfSingleDataElementChart(): AAChartModel {
+            val redStopsArr = arrayOf(
+                    arrayOf(0.0, AAColor.rgbaColor(255, 0, 0, 0.6f)),
+                    arrayOf(0.5, AAColor.rgbaColor(255, 0, 0, 0.0f)),
+                    arrayOf(1.0, AAColor.rgbaColor(255, 0, 0, 0.0f))
+                )
+            val gradientColorDic1= AAGradientColor.linearGradient(
+                AALinearGradientDirection.ToTop,
+                AAColor.rgbaColor(255, 215, 0, 0.1f),
+                AAColor.rgbaColor(255, 215, 0, 0.6f)
+            )
+            val formatStr =
+                "<img src=\"https://www.highcharts.com/samples/graphics/sun.png\">" +
+                        "<span style=\"color:#FFFFFF;font-weight:thin;font-size:25px\">{y}</span>" +
+                        "<span style=\"color:#FFFFFF;font-weight:thin;font-size:17px\"> m</span>"
+            val singleSpecialData = AADataElement()
+                .dataLabels(
+                    AADataLabels()
+                        .enabled(true)
+                        .useHTML(true)
+                        .format(formatStr)
+                        .style(AAStyle()
+                                .fontWeight(AAChartFontWeightType.Bold)
+                                .color(AAColor.whiteColor())
+                                .fontSize(16f)
+                        )
+                        .y(-35f)
+                        .align(AAChartAlignType.Center)
+                        .verticalAlign(AAChartVerticalAlignType.Top)
+                        .overflow("none")
+                        .crop(false)
+                )
+                .y(26.5f)
+
+            return AAChartModel()
+                .chartType(AAChartType.Areaspline)
+                .backgroundColor("#4b2b7f")
+                .dataLabelsEnabled(false) //是否显示值
+                .tooltipEnabled(true)
+                .markerRadius(0f)
+                .xAxisVisible(false)
+                .yAxisVisible(false)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("Virtual Data")
+                            .lineWidth(6f)
+                            .color("rgba(255,215,0,1)")
+                            .fillColor(gradientColorDic1) // gold color, alpha: 1.0
+                            .data(arrayOf(7.0, 6.9, 2.5, 14.5, 18.2, singleSpecialData, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6))
+                    )
+                )
+        }
+
+        fun customBarChartHoverColorAndSelectColor(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Bar)
+                .title("Custom Bar Chart select color")
+                .yAxisReversed(true)
+                .xAxisReversed(true)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("ElementOne")
+                            .data(arrayOf(211, 183, 157, 133, 111, 91, 73, 57, 43, 31, 21, 13, 7, 3))
+                            .allowPointSelect(true)
+                            .states(AAStates()
+                                    .hover(AAHover()
+                                            .color("rgba(220,20,60,1)")
+                                    ) //猩红色, alpha 透明度 1
+                                    .select(AASelect()
+                                            .color(AAColor.redColor())
+                                    )
+                            )
+                    )
+                )
+        }
+
+        fun customChartHoverAndSelectHaloStyle(): AAChartModel {
+            val hoverHaloAttributes = mapOf(
+                "stroke-width" to 50,
+                "fill" to "#00BFFF",
+                "stroke" to "#00FA9A"
+            )
+
+            val selectHaloAttributes = mapOf(
+                "stroke-width" to 150,
+                "fill" to AAColor.rgbaColor(138, 43, 226, 1f),
+                "stroke" to AAColor.rgbaColor(30, 144, 255, 1f)
+            )
+
+            return AAChartModel()
+                .chartType(AAChartType.Line)
+                .title("Custom Chart Hover And Select Halo Style")
+                .colorsTheme(arrayOf(AAColor.redColor()))
+                .yAxisReversed(true)
+                .xAxisReversed(true)
+                .markerRadius(20f)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("ElementOne")
+                            .data(arrayOf(211, 183, 157, 133, 111, 91, 73, 57, 43, 31, 21, 13, 7, 3))
+                            .allowPointSelect(true)
+                            .states(AAStates()
+                                    .hover(AAHover()
+                                            .halo(AAHalo()
+                                                    .size(130f)
+                                                    .opacity(0.8f)
+                                                    .attributes(hoverHaloAttributes)
+                                            )
+                                    )
+                                    .select(AASelect()
+                                            .halo(AAHalo()
+                                                    .size(130f)
+                                                    .opacity(1.0f)
+                                                    .attributes(selectHaloAttributes)
+                                            )
+                                    )
+                            )
+                    )
+                )
+        }
+
+        fun customSplineChartMarkerStatesHoverStyle(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Areaspline)
+                .title("Custom Spline Chart Marker States Hover Style")
+                .categories(arrayOf(
+                        "一月", "二月", "三月", "四月", "五月", "六月",
+                        "七月", "八月", "九月", "十月", "十一月", "十二月"))
+                .markerRadius(8.0f) //marker点半径为8个像素
+                .yAxisLineWidth(0f)
+                .yAxisGridLineWidth(0f)
+                .legendEnabled(false)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("Tokyo Hot")
+                            .lineWidth(5.0f)
+                            .color("rgba(220,20,60,1)") //猩红色, alpha 透明度 1
+                            .marker(AAMarker()
+                                    .states(AAMarkerStates()
+                                            .hover(AAMarkerHover()
+                                                    .fillColor(AAColor.whiteColor())
+                                                    .radius(40f)
+                                                    .lineColor(AAColor.greenColor())
+                                                    .lineWidth(20f)
+                                            )
+                                    )
+                            )
+                            .data(arrayOf(7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6))
+                    )
+                )
+        }
+
+
+        //Issue: https://github.com/AAChartModel/AAChartKit/issues/827
+        fun customNormalStackingChartDataLabelsContentAndStyle(): AAChartModel {
+            val categories = arrayOf(
+                "孤岛危机",
+                "使命召唤",
+                "荣誉勋章",
+                "狙击精英",
+                "神秘海域",
+                "最后生还者",
+                "巫师3狂猎",
+                "对马之魂",
+                "死亡搁浅",
+                "地狱边境",
+                "闪客",
+                "忍者之印"
+            )
+            val colorsTheme: Array<Any> = arrayOf(
+                "#fe117c",
+                "#ffc069",
+                "#06caf4",
+                "#7dffc0"
+            )
+            val element1 = AASeriesElement()
+                .name("2017")
+                .dataLabels(
+                    AADataLabels()
+                        .y(-10f)
+                        .format("{total} mm")
+                        .color(AAColor.redColor())
+                        .shape("callout")
+                        .backgroundColor(AAColor.whiteColor())
+                        .borderColor(AAColor.redColor())
+                        .borderRadius(1f)
+                        .borderWidth(1f)
+                )
+                .data(arrayOf(7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6))
+            val element2 = AASeriesElement()
+                .name("2018")
+                .data(arrayOf(0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5))
+            val element3 = AASeriesElement()
+                .name("2019")
+                .data(arrayOf(0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0))
+            val element4 = AASeriesElement()
+                .name("2020")
+                .data(arrayOf(3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8))
+            val series = arrayOf(element1, element2, element3, element4)
+            return AAChartModel()
+                .chartType(AAChartType.Column)
+                .stacking(AAChartStackingType.Normal)
+                .yAxisGridLineWidth(0f)
+                .markerRadius(0f)
+                .categories(categories)
+                .colorsTheme(colorsTheme)
+                .series(series)
+        }
+
+        //Issue: https://github.com/AAChartModel/AAChartKit-Swift/issues/190
+//API Doc: https://api.highcharts.com.cn/highcharts#series%3Cpyramid%3E.reversed
+        fun upsideDownPyramidChart(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Pyramid)
+                .yAxisTitle("摄氏度")
+                .inverted(true)
+                .legendEnabled(true)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("2020")
+                            .reversed(true)
+                            .data(arrayOf(
+                                    arrayOf("Swift",      15654),
+                                    arrayOf("Objective-C", 4064),
+                                    arrayOf("JavaScript",  1987),
+                                    arrayOf("GO",           976),
+                                    arrayOf("Python",       846)
+                                )
+                            )
+                    )
+                )
+        }
+
+        //Issue: https://github.com/AAChartModel/AAChartKit/issues/888
+        fun doubleLayerPieChart(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Pie)
+                .title("浏览器市场占比历史对比")
+                .subtitle("无任何可靠依据的虚拟数据")
+                .dataLabelsEnabled(true) //是否直接显示扇形图数据
+                .yAxisTitle("摄氏度")
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("Past")
+                            .size("40%") //尺寸大小
+                            .innerSize("30%") //内部圆环半径大小占比
+                            .borderWidth(0f) //描边的宽度
+                            .allowPointSelect(false) //是否允许在点击数据点标记(扇形图点击选中的块发生位移)
+                            .data(arrayOf(
+                                    arrayOf("Firefox Past", 3336.2),
+                                    arrayOf("Chrome Past",    26.8),
+                                    arrayOf("Safari Past",    88.5),
+                                    arrayOf("Opera Past",     46.0),
+                                    arrayOf("Others Past",   223.0)
+                                )
+                            ),
+                        AASeriesElement()
+                            .name("Now")
+                            .size("80%") //尺寸大小
+                            .innerSize("70%") //内部圆环半径大小占比
+                            .borderWidth(0f) //描边的宽度
+                            .allowPointSelect(false) //是否允许在点击数据点标记(扇形图点击选中的块发生位移)
+                            .data(arrayOf(
+                                    arrayOf("Firefox Now", 336.2),
+                                    arrayOf("Chrome Now", 6926.8),
+                                    arrayOf("Safari Now",  388.5),
+                                    arrayOf("Opera Now",   446.0),
+                                    arrayOf("Others Now",  223.0)
+                                )
+                            )
+                    )
+                )
+        }
+
+        //GitHub issue https://github.com/AAChartModel/AAChartKit/issues/903
+        fun disableSomeOfLinesMouseTrackingEffect(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Line) //图表类型
+                .tooltipValueSuffix("万元") //设置浮动提示框单位后缀
+                .yAxisTitle("万元") //设置 Y 轴标题
+                .categories(arrayOf(
+                        "一月", "二月", "三月", "四月", "五月", "六月",
+                        "七月", "八月", "九月", "十月", "十一月", "十二月"))
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("2017")
+                            .data(arrayOf(7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6)),
+                        AASeriesElement()
+                            .name("2018")
+                            .enableMouseTracking(false)
+                            .data(arrayOf(0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5)),
+                        AASeriesElement()
+                            .name("2019")
+                            .enableMouseTracking(false)
+                            .data(arrayOf(0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0)),
+                        AASeriesElement()
+                            .name("2020")
+                            .enableMouseTracking(false)
+                            .data(arrayOf(3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8))
+                    )
+                )
+        }
+
+
+        // GitHub issue https://github.com/AAChartModel/AAChartKit/issues/904
+        fun configureColorfulShadowSplineChart(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Spline)
+                .yAxisVisible(false)
+                .stacking(AAChartStackingType.Normal)
+                .colorsTheme(arrayOf("#1e90ff", "#ef476f", "#ffd066", "#04d69f"))
+                .markerSymbol(AAChartSymbolType.Circle)
+                .markerRadius(8.0f)
+                .markerSymbolStyle(AAChartSymbolStyleType.BorderBlank)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("2017")
+                            .lineWidth(5f)
+                            .data(arrayOf(0.45, 0.43, 0.50, 0.55, 0.58, 0.62, 0.83, 0.39, 0.56, 0.67, 0.50, 0.34, 0.50, 0.67, 0.58, 0.29, 0.46, 0.23, 0.47, 0.46, 0.38, 0.56, 0.48, 0.36))
+                            .shadow(AAShadow()
+                                    .offsetX(15.0f)
+                                    .offsetY(15.0f)
+                                    .opacity(0.2f)
+                                    .width(8.0f)
+                                    .color("#1e90ff")
+                            ),
+                        AASeriesElement()
+                            .name("2018")
+                            .lineWidth(5f)
+                            .data(arrayOf(0.38, 0.31, 0.32, 0.32, 0.64, 0.66, 0.86, 0.47, 0.52, 0.75, 0.52, 0.56, 0.54, 0.60, 0.46, 0.63, 0.54, 0.51, 0.58, 0.64, 0.60, 0.45, 0.36, 0.67))
+                            .shadow(AAShadow()
+                                    .offsetX(15.0f)
+                                    .offsetY(15.0f)
+                                    .opacity(0.2f)
+                                    .width(8.0f)
+                                    .color("#ef476f")
+                            ),
+                        AASeriesElement()
+                            .name("2019")
+                            .lineWidth(5f)
+                            .data(arrayOf(0.46, 0.32, 0.53, 0.58, 0.86, 0.68, 0.85, 0.73, 0.69, 0.71, 0.91, 0.74, 0.60, 0.50, 0.39, 0.67, 0.55, 0.49, 0.65, 0.45, 0.64, 0.47, 0.63, 0.64))
+                            .shadow(AAShadow()
+                                    .offsetX(15.0f)
+                                    .offsetY(15.0f)
+                                    .opacity(0.2f)
+                                    .width(8.0f)
+                                    .color("#ffd066")
+                            ),
+                        AASeriesElement()
+                            .name("2020")
+                            .lineWidth(5f)
+                            .data(arrayOf(0.60, 0.51, 0.52, 0.53, 0.64, 0.84, 0.65, 0.68, 0.63, 0.47, 0.72, 0.60, 0.65, 0.74, 0.66, 0.65, 0.71, 0.59, 0.65, 0.77, 0.52, 0.53, 0.58, 0.53))
+                            .shadow(AAShadow()
+                                    .offsetX(15.0f)
+                                    .offsetY(15.0f)
+                                    .opacity(0.2f)
+                                    .width(8.0f)
+                                    .color("#04d69f")
+                            )
+                    )
+                )
+        }
+
+        // GitHub issue https://github.com/AAChartModel/AAChartKit/issues/905
+        fun configureColorfulDataLabelsStepLineChart(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Line)
+                .yAxisVisible(false)
+                .stacking(AAChartStackingType.Normal)
+                .colorsTheme(arrayOf("#1e90ff", "#ef476f", "#ffd066", "#04d69f"))
+                .markerSymbol(AAChartSymbolType.Circle)
+                .markerRadius(8.0f)
+                .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)
+                .series(arrayOf(AASeriesElement()
+                            .name("2017")
+                            .step(true)
+                            .dataLabels(AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#1e90ff")
+                                            .fontSize(11f)))
+                            .data(arrayOf(2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30)),
+                        AASeriesElement()
+                            .name("2018")
+                            .step(true)
+                            .dataLabels(
+                                AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#ef476f")
+                                            .fontSize(11f)))
+                            .data(arrayOf(1.56, 1.91, 2.45, 3.87, 3.24, 4.90, 4.61, 4.10, 4.17, 3.85, 4.17, 3.46, 3.46, 3.55, 3.50, 4.13, 2.58, 2.28)),
+                        AASeriesElement()
+                            .name("2019")
+                            .step(true)
+                            .dataLabels(
+                                AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#ffd066")
+                                            .fontSize(11f)))
+                            .data(arrayOf(1.16, 1.67, 2.64, 2.86, 3.00, 3.21, 4.14, 4.07, 3.68, 3.11, 3.41, 3.25, 3.32, 3.07, 3.92, 3.05, 2.18, 3.24)),
+                        AASeriesElement()
+                            .name("2020")
+                            .step(true)
+                            .dataLabels(
+                                AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#04d69f")
+                                            .fontSize(11f)))
+                            .data(arrayOf(5.59, 3.09, 4.09, 6.14, 5.33, 6.05, 5.71, 6.22, 6.56, 4.75, 5.27, 6.02, 5.22, 5.77, 6.19, 5.68, 4.33, 5.48))
+                    )
+                )
+        }
+
+
+        // GitHub issue https://github.com/AAChartModel/AAChartKit-Swift/issues/223
+        fun configureColorfulGradientColorAndColorfulDataLabelsStepAreaChart(): AAChartModel {
+            val blueStopsArr: Array<Any> = arrayOf(
+                    arrayOf(0.0, AAColor.rgbaColor(30, 144, 255, 1.0f)),
+                    arrayOf(0.5, AAColor.rgbaColor(30, 144, 255, 0.2f)),
+                    arrayOf(1.0, AAColor.rgbaColor(30, 144, 255, 0.0f))
+                )
+            val gradientBlueColorDic = AAGradientColor.linearGradient(
+                AALinearGradientDirection.ToBottom,
+                blueStopsArr
+            )
+
+            val redStopsArr: Array<Any> = arrayOf(
+                arrayOf(0.0, AAColor.rgbaColor(255, 0, 0, 1.0f)),
+                arrayOf(0.5, AAColor.rgbaColor(255, 0, 0, 0.2f)),
+                arrayOf(1.0, AAColor.rgbaColor(255, 0, 0, 0.0f))
+            )
+            val gradientRedColorDic = AAGradientColor.linearGradient(
+                AALinearGradientDirection.ToBottom,
+                redStopsArr
+            )
+
+            val goldStopsArr: Array<Any> = arrayOf(
+                arrayOf(0.0, AAColor.rgbaColor(255, 215, 0, 1.0f)),
+                arrayOf(0.5, AAColor.rgbaColor(255, 215, 0, 0.2f)),
+                arrayOf(1.0, AAColor.rgbaColor(255, 215, 0, 0.0f))
+            )
+            val gradientGoldColorDic = AAGradientColor.linearGradient(
+                AALinearGradientDirection.ToBottom,
+                goldStopsArr
+            )
+
+            val greenStopsArr: Array<Any> = arrayOf(
+                arrayOf(0.0, AAColor.rgbaColor(50, 205, 50, 1.0f)),
+                arrayOf(0.5, AAColor.rgbaColor(50, 205, 50, 0.2f)),
+                arrayOf(1.0, AAColor.rgbaColor(50, 205, 50, 0.0f))
+            )
+            val gradientGreenColorDic = AAGradientColor.linearGradient(
+                AALinearGradientDirection.ToBottom,
+                greenStopsArr
+            )
+            
+            
+            return AAChartModel()
+                .chartType(AAChartType.Area)
+                .yAxisVisible(false)
+                .stacking(AAChartStackingType.Normal)
+                .colorsTheme(arrayOf("#1e90ff", "#ef476f", "#ffd066", "#04d69f"))
+                .markerSymbol(AAChartSymbolType.Circle)
+                .markerRadius(5f)
+                .dataLabelsEnabled(false)
+                .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("2017")
+                            .fillColor(gradientBlueColorDic)
+                            .lineWidth(6f)
+                            .step(true)
+                            .dataLabels(
+                                AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#1e90ff")
+                                            .fontSize(11f)))
+                            .data(arrayOf(2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30)),
+
+                    AASeriesElement()
+                            .name("2018")
+                            .fillColor(gradientRedColorDic)
+                            .lineWidth(6f)
+                            .step(true)
+                            .dataLabels(
+                                AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#ef476f")
+                                            .fontSize(11f)))
+                            .data(arrayOf(1.56, 1.91, 2.45, 3.87, 3.24, 4.90, 4.61, 4.10, 4.17, 3.85, 4.17, 3.46, 3.46, 3.55, 3.50, 4.13, 2.58, 2.28)),
+
+                    AASeriesElement()
+                            .name("2019")
+                            .fillColor(gradientGoldColorDic)
+                            .lineWidth(6f)
+                            .step(true)
+                            .dataLabels(
+                                AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#ffd066")
+                                            .fontSize(11f)))
+                            .data(arrayOf(1.16, 1.67, 2.64, 2.86, 3.00, 3.21, 4.14, 4.07, 3.68, 3.11, 3.41, 3.25, 3.32, 3.07, 3.92, 3.05, 2.18, 3.24)),
+
+                    AASeriesElement()
+                            .name("2020")
+                            .fillColor(gradientGreenColorDic)
+                            .lineWidth(6f)
+                            .step(true)
+                            .dataLabels(
+                                AADataLabels()
+                                    .style(AAStyle()
+                                            .color("#04d69f")
+                                            .fontSize(11f)))
+                            .data(arrayOf(5.59, 3.09, 4.09, 6.14, 5.33, 6.05, 5.71, 6.22, 6.56, 4.75, 5.27, 6.02, 5.22, 5.77, 6.19, 5.68, 4.33, 5.48))
+                )
+                )
+        }
+
+        // Refer to https://api.highcharts.com.cn/highcharts#plotOptions.spline.marker.states.hover.enabled
+        fun disableSplineChartMarkerHoverEffect(): AAChartModel {
+            return AAChartModel()
+                .chartType(AAChartType.Spline)
+                .title("Disable Spline Chart Marker Hover Effect")
+                .categories(arrayOf(
+                        "一月", "二月", "三月", "四月", "五月", "六月",
+                        "七月", "八月", "九月", "十月", "十一月", "十二月"))
+                .markerRadius(0f) //marker点半径为0个像素
+                .yAxisLineWidth(0f)
+                .yAxisGridLineWidth(0f)
+                .legendEnabled(false)
+                .series(arrayOf(
+                        AASeriesElement()
+                            .name("Tokyo Hot")
+                            .lineWidth(5.0f)
+                            .color("rgba(220,20,60,1)") //猩红色, alpha 透明度 1
+                            .marker(AAMarker()
+                                    .states(AAMarkerStates()
+                                            .hover(AAMarkerHover()
+                                                    .enabled(false))))
+                            .data(arrayOf(7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6))
+                    )
+                )
+        }
+
     }
 
 

+ 120 - 0
app/src/main/java/com/aachartmodel/aainfographics/ChartsDemo/ChartComposer/MixedChartComposer.kt

@@ -29,7 +29,10 @@ package com.aachartmodel.aainfographics.ChartsDemo.ChartComposer
 
 import com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.*
 import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.AADataLabels
+import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.AAMarker
+import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.AAPie
 import com.aachartmodel.aainfographics.AAInfographicsLib.AAOptionsModel.AAStyle
+import java.util.*
 
 class MixedChartComposer {
 companion object {
@@ -624,5 +627,122 @@ companion object {
             )
             )
     }
+
+    fun configurePieMixedLineMixedColumnChart(): AAChartModel? {
+        val columnElement1 = AASeriesElement()
+            .name("Anna")
+            .type(AAChartType.Column)
+            .data(arrayOf(3, 2, 1, 3, 4))
+        val columnElement2 = AASeriesElement()
+            .name("Babara")
+            .type(AAChartType.Column)
+            .data(arrayOf(2, 3, 5, 7, 6))
+        val columnElement3 = AASeriesElement()
+            .name("Coco")
+            .type(AAChartType.Column)
+            .data(arrayOf(4, 3, 3, 9, 0))
+        val lineElement = AASeriesElement()
+            .name("average value")
+            .type(AAChartType.Line)
+            .data(arrayOf(3, 2.67, 3, 6.33, 3.33))
+            .marker(
+                AAMarker()
+                    .fillColor("#1E90FF")
+                    .lineWidth(2.0f)
+                    .lineColor(AAColor.whiteColor())
+            )
+        val pieElement = AAPie()
+            .type(AAChartType.Pie)
+            .center(arrayOf(100, 80))
+            .size(100f)
+            .showInLegend(true)
+            .dataLabels(AADataLabels()
+                    .enabled(false)
+            )
+            .data(arrayOf(
+                    AADataElement()
+                        .name("Ada")
+                        .y(13.0f)
+                        .color(AAGradientColor.oceanBlueColor())
+                    ,
+                    AADataElement()
+                        .name("Bob")
+                        .y(13.0f)
+                        .color(AAGradientColor.sanguineColor())
+                    ,
+                    AADataElement()
+                        .name("Coco")
+                        .y(13.0f)
+                        .color(AAGradientColor.purpleLakeColor())
+                )
+            )
+
+        return AAChartModel()
+            .stacking(AAChartStackingType.Normal)
+            .colorsTheme(arrayOf(
+                    AAGradientColor.oceanBlueColor(),
+                    AAGradientColor.sanguineColor(),
+                    AAGradientColor.purpleLakeColor()
+                )
+            )
+            .dataLabelsEnabled(false)
+            .series(arrayOf(
+                    columnElement1,
+                    columnElement2,
+                    columnElement3,
+                    lineElement,
+                    pieElement as AASeriesElement
+                )
+            )
+    }
+
+
+    //GitHub issue https://github.com/AAChartModel/AAChartKit/issues/921
+    private fun configureNegativeColorMixedAreasplineChart(): AAChartModel? {
+        val blueStopsArr: Array<Any> = arrayOf(
+                arrayOf(0.0, AAColor.rgbaColor(30, 144, 255, 0.0f)),
+                arrayOf(0.5, AAColor.rgbaColor(30, 144, 255, 0.0f)),
+                arrayOf(1.0, AAColor.rgbaColor(30, 144, 255, 0.6f))
+            )
+        val gradientBlueColorDic = AAGradientColor.linearGradient(
+            AALinearGradientDirection.ToTop,
+            blueStopsArr
+        )
+
+        val redStopsArr: Array<Any> = arrayOf(
+            arrayOf(0.0, AAColor.rgbaColor(255, 0, 0, 0.6f)),
+            arrayOf(0.5, AAColor.rgbaColor(255, 0, 0, 0.0f)),
+            arrayOf(1.0, AAColor.rgbaColor(255, 0, 0, 0.0f))
+        )
+        val gradientRedColorDic = AAGradientColor.linearGradient(
+            AALinearGradientDirection.ToTop,
+            redStopsArr
+        )
+
+        return AAChartModel()
+            .chartType(AAChartType.Area)
+            .legendEnabled(false)
+            .dataLabelsEnabled(false)
+            .markerRadius(5f)
+            .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)
+            .yAxisGridLineWidth(0f)
+            .series(arrayOf(
+                AASeriesElement()
+                    .name("Column")
+                    .data(arrayOf(
+                        7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6,
+                        -7.0, -6.9, -2.5, -14.5, -18.2, -21.5, -5.2, -26.5, -23.3, -45.3, -13.9, -9.6
+                    ))
+                    .lineWidth(5f)
+                    .color(AAColor.rgbaColor(30, 144, 255, 1.0f))
+                    .negativeColor(AAColor.rgbaColor(255, 0, 0, 1.0f))
+                    .fillColor(gradientBlueColorDic)
+                    .negativeFillColor(gradientRedColorDic)
+                    .threshold(0f) //default:0
+            )
+            )
     }
+
+
+}
 }