Browse Source

Optimize some details

An An 5 năm trước cách đây
mục cha
commit
00cf3c35cc

+ 23 - 25
app/src/main/java/com/aachartmodel/aainfographics/AAInfographicsLib/AAChartConfiger/AAChartView.kt

@@ -6,32 +6,30 @@
 //  Copyright © 2018年 An An. All rights reserved.
 */
 /**
- * ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉
- * ◉◉◉...................................................       ◉◉◉
- * ◉◉◉   https://github.com/AAChartModel/AAChartCore            ◉◉◉
- * ◉◉◉   https://github.com/AAChartModel/AAChartCore-Kotlin     ◉◉◉
- * ◉◉◉...................................................       ◉◉◉
- * ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉
- */
+* ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉
+* ◉◉◉...................................................       ◉◉◉
+* ◉◉◉   https://github.com/AAChartModel/AAChartCore            ◉◉◉
+* ◉◉◉   https://github.com/AAChartModel/AAChartCore-Kotlin     ◉◉◉
+* ◉◉◉...................................................       ◉◉◉
+* ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉
+
+
+* -------------------------------------------------------------------------------
+*
+*  🌕 🌖 🌗 🌘  ❀❀❀   WARM TIPS!!!   ❀❀❀ 🌑 🌒 🌓 🌔
+*
+* Please contact me on GitHub,if there are any problems encountered in use.
+* GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues
+* -------------------------------------------------------------------------------
+* And if you want to contribute for this project, please contact me as well
+* GitHub        : https://github.com/AAChartModel
+* StackOverflow : https://stackoverflow.com/users/7842508/codeforu
+* JianShu       : http://www.jianshu.com/u/f1e6753d4254
+* SegmentFault  : https://segmentfault.com/u/huanghunbieguan
+*
+* -------------------------------------------------------------------------------
 
-/**
-
- * -------------------------------------------------------------------------------
- *
- *  🌕 🌖 🌗 🌘  ❀❀❀   WARM TIPS!!!   ❀❀❀ 🌑 🌒 🌓 🌔
- *
- * Please contact me on GitHub,if there are any problems encountered in use.
- * GitHub Issues : https://github.com/AAChartModel/AAChartCore-Kotlin/issues
- * -------------------------------------------------------------------------------
- * And if you want to contribute for this project, please contact me as well
- * GitHub        : https://github.com/AAChartModel
- * StackOverflow : https://stackoverflow.com/users/7842508/codeforu
- * JianShu       : http://www.jianshu.com/u/f1e6753d4254
- * SegmentFault  : https://segmentfault.com/u/huanghunbieguan
- *
- * -------------------------------------------------------------------------------
-
- */
+*/
 
 package com.aachartmodel.aainfographics.aainfographicsLib.aachartConfiger
 

+ 2 - 5
app/src/main/java/com/aachartmodel/aainfographics/ChartsDemo/BasicContent/CommonChartActivity.kt

@@ -74,11 +74,10 @@ class CommonChartActivity : AppCompatActivity(), RadioGroup.OnCheckedChangeListe
 
         aaChartModel
             .chartType(chartTypeEnum)
-            .title("title")
-            .subtitle("subtitle")
             .backgroundColor("#4b2b7f")
             .dataLabelsEnabled(false)
             .yAxisGridLineWidth(0f)
+            .legendEnabled(false)
             .series(arrayOf(
                 AASeriesElement()
                     .name("Tokyo")
@@ -135,16 +134,14 @@ class CommonChartActivity : AppCompatActivity(), RadioGroup.OnCheckedChangeListe
     private fun configureColumnChartAndBarChartStyle() {
         aaChartModel
             .categories(arrayOf("Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Spe", "Oct", "Nov", "Dec"))
-            .legendEnabled(true)
             .colorsTheme(arrayOf("#fe117c", "#ffc069", "#06caf4", "#7dffc0"))
-            .animationType(AAChartAnimationType.EaseInQuart)
+            .animationType(AAChartAnimationType.EaseInCubic)
             .animationDuration(1200)
     }
 
     private fun configureAreaChartAndAreasplineChartStyle(chartType:String) {
         aaChartModel
             .animationType(AAChartAnimationType.EaseOutQuart)
-            .legendEnabled(true)
             .markerRadius(5f)
             .markerSymbol(AAChartSymbolType.Circle)
             .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)

+ 6 - 4
app/src/main/java/com/aachartmodel/aainfographics/ChartsDemo/ChartComposer/CustomTooltipComposer.kt

@@ -108,7 +108,7 @@ function () {
                 .subtitle("数据来源:www.无任何可靠依据.com")//图表副标题
                 .markerSymbolStyle(AAChartSymbolStyleType.BorderBlank)//折线连接点样式为外边缘空白
                 .dataLabelsEnabled(false)
-                .colorsTheme(arrayOf<Any>("#ff0000", "#0000ff"))
+                .colorsTheme(arrayOf("#ff0000", "#0000ff"))
                 .stacking(AAChartStackingType.Normal)
                 .series(arrayOf(
                     AASeriesElement()
@@ -202,7 +202,7 @@ function () {
                 .subtitle("")//图表副标题
                 .markerSymbolStyle(AAChartSymbolStyleType.BorderBlank)//折线连接点样式为外边缘空白
                 .dataLabelsEnabled(false)
-                .colorsTheme(arrayOf<Any>("#04d69f", "#1e90ff", "#ef476f", "#ffd066"))
+                .colorsTheme(arrayOf("#04d69f", "#1e90ff", "#ef476f", "#ffd066"))
                 .stacking(AAChartStackingType.Normal)
                 .markerRadius(0f)
                 .series(arrayOf(
@@ -316,7 +316,8 @@ function () {
                 .colorsTheme(arrayOf("#04d69f", "#1e90ff", "#ef476f", "#ffd066"))
                 .stacking(AAChartStackingType.Normal)
                 .markerRadius(8f)
-                .series(arrayOf(AASeriesElement()
+                .series(arrayOf(
+                    AASeriesElement()
                     .name("Tokyo Hot")
                     .lineWidth(5.0f)
                     .fillOpacity(0.4f)
@@ -364,7 +365,8 @@ function () {
                     .data(arrayOf(229.9, 771.5, 1106.4, 1129.2, 6644.0, 1176.0, 8835.6, 148.5, 8816.4, 6694.1, 7795.6, 9954.4))))
 
             val aaYAxisLabels = AALabels()
-                .style(AAStyle()
+                .style(
+                    AAStyle()
                     .fontSize(10f)
                     .fontWeight(AAChartFontWeightType.Bold)
                     .color(AAColor.grayColor())