diff --git a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartComposer.swift b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartComposer.swift index 43a466f..4ea6c86 100644 --- a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartComposer.swift +++ b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartComposer.swift @@ -21,11 +21,22 @@ class CustomStyleForBarChartComposer { static func randomColorfulBarChart() -> AAChartModel { CustomStyleForColumnChartComposer.randomColorfulColumnChart().chartType(.bar) } - - static func stackingPolarBarChart() -> AAChartModel { - CustomStyleForColumnChartComposer.stackingPolarColumnChart().chartType(.bar) + + + + static func noneStackingPolarBarChart() -> AAChartModel { + CustomStyleForColumnChartComposer.noneStackingPolarColumnChart().chartType(.bar) } - + + static func normalStackingPolarBarChart() -> AAChartModel { + CustomStyleForColumnChartComposer.normalStackingPolarColumnChart().chartType(.bar) + + } + + static func percentStackingPolarBarChart() -> AAChartModel { + CustomStyleForColumnChartComposer.percentStackingPolarColumnChart().chartType(.bar) + } + diff --git a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartVC.swift b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartVC.swift index 44a4790..765de39 100644 --- a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartVC.swift +++ b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForBarChartVC.swift @@ -14,64 +14,17 @@ class CustomStyleForBarChartVC: AABaseChartVC { // Do any additional setup after loading the view. } -// private func colorfulBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.colorfulColumnChart() -// } -// -// private func colorfulGradientColorBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.colorfulGradientColorColumnChart() -// } -// -// private func discontinuousDataBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.discontinuousDataColumnChart() -// } -// -// private func randomColorfulBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.randomColorfulColumnChart() -// } -// -// private func stackingPolarBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.stackingPolarColumnChart() -// } - -// private func specialStyleForTheSingleDataElementOfColumnChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.specialStyleForTheSingleDataElementOfColumnChart() -// } -// -// private func noMoreGroupingAndOverlapEachOtherBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.noMoreGroupingAndOverlapEachOtherColumnChart() -// } -// -// private func noMoreGroupingAndNestedBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.noMoreGroupingAndNestedColumnChart() -// } -// -// private func topRoundedCornersStackingBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.topRoundedCornersStackingColumnChart() -// } -// -// private func freeStyleRoundedCornersStackingBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.freeStyleRoundedCornersStackingColumnChart() -// } -// -// -// -// -// private func customBorderStyleAndStatesHoverColorBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.customBorderStyleAndStatesHoverColorColumnChart() -// } -// -// private func negativeDataMixedPositiveDataBarChart() -> AAChartModel { -// CustomStyleForColumnChartComposer.negativeDataMixedPositiveDataColumnChart() -// } override func chartConfigurationWithSelectedChartTypeString(_ selectedChartTypeStr: String) -> Any? { switch selectedChartTypeStr { case "colorfulBarChart":return CustomStyleForBarChartComposer.colorfulBarChart() case "colorfulGradientColorBarChart":return CustomStyleForBarChartComposer.colorfulGradientColorBarChart() case "discontinuousDataBarChart":return CustomStyleForBarChartComposer.discontinuousDataBarChart() case "randomColorfulBarChart":return CustomStyleForBarChartComposer.randomColorfulBarChart() - case "stackingPolarBarChart":return CustomStyleForBarChartComposer.stackingPolarBarChart() + + case "noneStackingPolarBarChart":return CustomStyleForBarChartComposer.noneStackingPolarBarChart() + case "normalStackingPolarBarChart":return CustomStyleForBarChartComposer.normalStackingPolarBarChart() + case "percentStackingPolarBarChart":return CustomStyleForBarChartComposer.percentStackingPolarBarChart() case "specialStyleForTheSingleDataElementOfBarChart":return CustomStyleForBarChartComposer.specialStyleForTheSingleDataElementOfBarChart() case "noMoreGroupingAndOverlapEachOtherBarChart":return CustomStyleForBarChartComposer.noMoreGroupingAndOverlapEachOtherBarChart() diff --git a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartComposer.swift b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartComposer.swift index cbe5733..d08e10e 100644 --- a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartComposer.swift +++ b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartComposer.swift @@ -169,33 +169,43 @@ class CustomStyleForColumnChartComposer { .colorByPoint(true)//When using automatic point colors pulled from the options.colors collection, this option determines whether the chart should receive one color per series or one color per point. Default Value:false. ]) } - - static func stackingPolarColumnChart() -> AAChartModel { + + static func noneStackingPolarColumnChart() -> AAChartModel { AAChartModel() - .chartType(.column) - .xAxisLabelsStyle(AAStyle(color: AAColor.white)) - .dataLabelsEnabled(false) - .backgroundColor("#22324c")//To make the chart background color transparent, set backgroundColor to "rgba (0,0,0,0)" or "# 00000000". Also make sure `aaChartView!.IsClearBackgroundColor = true` - .polar(true) - .stacking(.percent) - .series([ - AASeriesElement() - .name("Tokyo") - .data([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("New York") - .data([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("Berlin") - .data([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("London") - .data([3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]) - , - ]) + .chartType(.column) + .xAxisLabelsStyle(AAStyle(color: AAColor.white)) + .dataLabelsEnabled(false) + .backgroundColor("#22324c")//To make the chart background color transparent, set backgroundColor to "rgba (0,0,0,0)" or "# 00000000". Also make sure `aaChartView!.IsClearBackgroundColor = true` + .polar(true) + .stacking(.none) + .series([ + AASeriesElement() + .name("Tokyo") + .data([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("New York") + .data([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("Berlin") + .data([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("London") + .data([3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]) + , + ]) + } + + static func normalStackingPolarColumnChart() -> AAChartModel { + noneStackingPolarColumnChart() + .stacking(.normal) + } + + static func percentStackingPolarColumnChart() -> AAChartModel { + noneStackingPolarColumnChart() + .stacking(.percent) } static func specialStyleForTheSingleDataElementOfColumnChart() -> AAChartModel { diff --git a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartVC.swift b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartVC.swift index 1b63d94..72bad78 100644 --- a/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartVC.swift +++ b/AAInfographicsDemo/Demo/AAChartModel/CustomStyleForColumnChartVC.swift @@ -21,7 +21,10 @@ class CustomStyleForColumnChartVC: AABaseChartVC { case "colorfulGradientColorColumnChart":return CustomStyleForColumnChartComposer.colorfulGradientColorColumnChart() case "discontinuousDataColumnChart":return CustomStyleForColumnChartComposer.discontinuousDataColumnChart() case "randomColorfulColumnChart":return CustomStyleForColumnChartComposer.randomColorfulColumnChart() - case "stackingPolarColumnChart":return CustomStyleForColumnChartComposer.stackingPolarColumnChart() + + case "noneStackingPolarColumnChart":return CustomStyleForColumnChartComposer.noneStackingPolarColumnChart() + case "normalStackingPolarColumnChart":return CustomStyleForColumnChartComposer.normalStackingPolarColumnChart() + case "percentStackingPolarColumnChart":return CustomStyleForColumnChartComposer.percentStackingPolarColumnChart() case "specialStyleForTheSingleDataElementOfColumnChart":return CustomStyleForColumnChartComposer.specialStyleForTheSingleDataElementOfColumnChart() case "noMoreGroupingAndOverlapEachOtherColumnChart":return CustomStyleForColumnChartComposer.noMoreGroupingAndOverlapEachOtherColumnChart() diff --git a/AAInfographicsDemo/Demo/MainVC.swift b/AAInfographicsDemo/Demo/MainVC.swift index 5e10e9b..dc28c6f 100644 --- a/AAInfographicsDemo/Demo/MainVC.swift +++ b/AAInfographicsDemo/Demo/MainVC.swift @@ -208,7 +208,10 @@ class MainVC: UIViewController { "colorfulGradientColorColumnChart---多彩颜色渐变柱状图", "discontinuousDataColumnChart---数值不连续の柱状图", "randomColorfulColumnChart---随机颜色の多彩柱状图", - "stackingPolarColumnChart---堆积效果の极化柱状图", + + "noneStackingPolarColumnChart---无堆积效果の极化柱状图", + "normalStackingPolarColumnChart---常规堆积效果の极化柱状图", + "percentStackingPolarColumnChart---百分比堆积效果の极化柱状图", "specialStyleForTheSingleDataElementOfColumnChart---单个数据元素特别风格柱状图", "noMoreGroupingAndOverlapEachOtherColumnChart---不分组的相互重叠柱状图", @@ -225,7 +228,10 @@ class MainVC: UIViewController { "colorfulGradientColorBarChart---多彩颜色渐变条形图", "discontinuousDataBarChart---数值不连续の条形图", "randomColorfulBarChart---随机颜色の多彩条形图", - "stackingPolarBarChart---堆积效果の极化条形图", + + "noneStackingPolarBarChart---无堆积效果の极化条形图", + "normalStackingPolarBarChart---常规堆积效果の极化条形图", + "percentStackingPolarBarChart---百分比堆积效果の极化条形图", "specialStyleForTheSingleDataElementOfColumnChart---单个数据元素特别风格条形图", "noMoreGroupingAndOverlapEachOtherBarChart---不分组的相互重叠条形图", @@ -316,7 +322,10 @@ class MainVC: UIViewController { "colorfulGradientColorColumnChart", "discontinuousDataColumnChart", "randomColorfulColumnChart", - "stackingPolarColumnChart", + + "noneStackingPolarColumnChart", + "normalStackingPolarColumnChart", + "percentStackingPolarColumnChart", "specialStyleForTheSingleDataElementOfColumnChart", "noMoreGroupingAndOverlapEachOtherColumnChart", @@ -333,7 +342,10 @@ class MainVC: UIViewController { "colorfulGradientColorBarChart", "discontinuousDataBarChart", "randomColorfulBarChart", - "stackingPolarBarChart", + + "noneStackingPolarBarChart", + "normalStackingPolarBarChart", + "percentStackingPolarBarChart", "specialStyleForTheSingleDataElementOfBarChart", "noMoreGroupingAndOverlapEachOtherBarChart",