Skip to content

Commit c756ced

Browse files
committed
Reorganize AAOptions into Composer/ViewController
Refactor AAChartKitDemo project structure for AAOptions: add Composer and ViewController subgroups, introduce multiple Composer header/implementation files and corresponding ViewController files, and update project.pbxproj with new PBXFileReference and PBXBuildFile entries. Removed outdated DrawChartWithAAOptions references and consolidated AAOptions-related sources into the new folders to improve organization and maintainability.
1 parent d49a71f commit c756ced

50 files changed

Lines changed: 923 additions & 495 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AAChartKitDemo.xcodeproj/project.pbxproj

Lines changed: 160 additions & 78 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// AreasplineChartOptionsComposer.h
3+
// AAChartKitDemo
4+
//
5+
6+
#import <Foundation/Foundation.h>
7+
#import "AAChartKit.h"
8+
9+
NS_ASSUME_NONNULL_BEGIN
10+
11+
@interface AreasplineChartOptionsComposer : NSObject
12+
13+
+ (AAOptions *)configureComplicatedCustomAreasplineChart;
14+
+ (AAOptions *)configureComplicatedCustomAreasplineChart2;
15+
+ (AAOptions *)configureComplicatedCustomAreasplineChart3;
16+
+ (AAOptions *)fanChart;
17+
18+
@end
19+
20+
NS_ASSUME_NONNULL_END

AAChartKitDemo/Demo/AAOptions/AreasplineChartOptionsVC.m renamed to AAChartKitDemo/Demo/AAOptions/Composer/AreasplineChartOptionsComposer.m

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
//
2-
// AreasplineChartOptionsVC.m
2+
// AreasplineChartOptionsComposer.m
33
// AAChartKitDemo
44
//
55
// Created by Admin on 2021/9/16.
66
// Copyright © 2021 An An. All rights reserved.
77
//
88

9-
#import "AreasplineChartOptionsVC.h"
9+
#import "AreasplineChartOptionsComposer.h"
1010

11-
@interface AreasplineChartOptionsVC ()
11+
@interface AreasplineChartOptionsComposer ()
1212

1313
@end
1414

15-
@implementation AreasplineChartOptionsVC
15+
@implementation AreasplineChartOptionsComposer
1616

17-
- (void)viewDidLoad {
18-
[super viewDidLoad];
19-
// Do any additional setup after loading the view.
20-
}
21-
22-
- (id)chartConfigurationWithSelectedIndex:(NSUInteger)selectedIndex {
23-
switch (self.selectedIndex) {
24-
case 0: return [self configureComplicatedCustomAreasplineChart];//复杂自定义曲线填充图 1
25-
case 1: return [self configureComplicatedCustomAreasplineChart2];//复杂自定义曲线填充图 2
26-
case 2: return [self configureComplicatedCustomAreasplineChart3];//复杂自定义曲线填充图 3
27-
case 3: return [self fanChart];//折扇图
2817

29-
default:
30-
break;
31-
}
32-
return nil;
33-
}
3418

3519
// https://github.com/AAChartModel/AAChartKit/issues/941
36-
- (AAOptions *)configureComplicatedCustomAreasplineChart {
20+
+ (AAOptions *)configureComplicatedCustomAreasplineChart {
3721
AAChart *aaChart = AAChart.new
3822
.typeSet(AAChartTypeAreaspline)
3923
.backgroundColorSet(AAColor.blackColor);
@@ -192,7 +176,7 @@ - (AAOptions *)configureComplicatedCustomAreasplineChart {
192176
return aaOptions;
193177
}
194178

195-
- (AAOptions *)configureComplicatedCustomAreasplineChart2 {
179+
+ (AAOptions *)configureComplicatedCustomAreasplineChart2 {
196180
AAOptions *aaOptions = [self configureComplicatedCustomAreasplineChart];
197181

198182
aaOptions.chart.backgroundColor = (id)AAGradientColor.new
@@ -313,7 +297,7 @@ - (AAOptions *)configureComplicatedCustomAreasplineChart2 {
313297
return aaOptions;
314298
}
315299

316-
- (AAOptions *)configureComplicatedCustomAreasplineChart3 {
300+
+ (AAOptions *)configureComplicatedCustomAreasplineChart3 {
317301
AAStyle *aaDataLabelsStyle = AAStyle.new
318302
.fontWeightSet(AAChartFontWeightTypeBold)
319303
.colorSet(AAColor.whiteColor)
@@ -419,7 +403,7 @@ - (AAOptions *)configureComplicatedCustomAreasplineChart3 {
419403
return aaOptions;
420404
}
421405

422-
- (AAOptions *)fanChart {
406+
+ (AAOptions *)fanChart {
423407
return AAOptions.new
424408
.chartSet(AAChart.new
425409
.typeSet(AAChartTypeArearange)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// DataLabelsOptionsComposer.h
3+
// AAChartKitDemo
4+
//
5+
6+
#import <Foundation/Foundation.h>
7+
#import "AAChartKit.h"
8+
9+
NS_ASSUME_NONNULL_BEGIN
10+
11+
@interface DataLabelsOptionsComposer : NSObject
12+
13+
+ (AAOptions *)adjustChartDataLabelsStyle;
14+
+ (AAOptions *)customizeEveryDataLabelBySinglely;
15+
+ (AAOptions *)configureStackingColumnChartDataLabelsOverflow;
16+
+ (AAOptions *)configureReversedBarChartDataLabelsStyle;
17+
+ (AAOptions *)configureColumnChartDataLabelsLayout;
18+
19+
@end
20+
21+
NS_ASSUME_NONNULL_END

AAChartKitDemo/Demo/AAOptions/DataLabelsOptionsVC.m renamed to AAChartKitDemo/Demo/AAOptions/Composer/DataLabelsOptionsComposer.m

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,24 @@
11
//
2-
// DataLabelsOptionsVC.m
2+
// DataLabelsOptionsComposer.m
33
// AAChartKitDemo
44
//
55
// Created by Admin on 2021/9/16.
66
// Copyright © 2021 An An. All rights reserved.
77
//
88

9-
#import "DataLabelsOptionsVC.h"
9+
#import "DataLabelsOptionsComposer.h"
1010

11-
@interface DataLabelsOptionsVC ()
11+
@interface DataLabelsOptionsComposer ()
1212

1313
@end
1414

15-
@implementation DataLabelsOptionsVC
16-
17-
- (void)viewDidLoad {
18-
[super viewDidLoad];
19-
// Do any additional setup after loading the view.
20-
}
15+
@implementation DataLabelsOptionsComposer
2116

2217

23-
- (id)chartConfigurationWithSelectedIndex:(NSUInteger)selectedIndex {
24-
switch (self.selectedIndex) {
25-
case 0: return [self adjustChartDataLabelsStyle];//自定义DataLabels样式
26-
case 1: return [self customizeEveryDataLabelBySinglely];//单独自定义指定的data的DataLabels样式
27-
case 2: return [self configureStackingColumnChartDataLabelsOverflow];//允许DataLabels文字溢出绘图区
28-
case 3: return [self configureReversedBarChartDataLabelsStyle];//调整Y轴倒转的条形图的DataLabels风格样式
29-
case 4: return [self configureColumnChartDataLabelsLayout];//配置柱状图📊的 dataLabels 布局
3018

31-
default:
32-
break;
33-
}
34-
return nil;
35-
}
3619

3720
// Refer to the issue https://github.com/AAChartModel/AAChartKit/issues/521
38-
- (AAOptions *)adjustChartDataLabelsStyle {
21+
+ (AAOptions *)adjustChartDataLabelsStyle {
3922
AAChartModel *aaChartModel = AAChartModel.new
4023
.chartTypeSet(AAChartTypeSpline)//图表类型
4124
.markerRadiusSet(@7)
@@ -73,7 +56,7 @@ - (AAOptions *)adjustChartDataLabelsStyle {
7356
}
7457

7558
// Refer to the issue https://github.com/AAChartModel/AAChartKit/issues/589
76-
- (AAOptions *)customizeEveryDataLabelBySinglely {
59+
+ (AAOptions *)customizeEveryDataLabelBySinglely {
7760
NSArray *dataArr = @[
7861
AADataElement.new
7962
.dataLabelsSet(AADataLabels.new
@@ -152,7 +135,7 @@ - (AAOptions *)customizeEveryDataLabelBySinglely {
152135
}
153136

154137
// Refer to the issue https://github.com/AAChartModel/AAChartKit/issues/707
155-
- (AAOptions *)configureStackingColumnChartDataLabelsOverflow {
138+
+ (AAOptions *)configureStackingColumnChartDataLabelsOverflow {
156139
AAChartModel *aaChartModel = AAChartModel.new
157140
.chartTypeSet(AAChartTypeColumn)
158141
.subtitleSet(@"检测数量")
@@ -192,7 +175,7 @@ - (AAOptions *)configureStackingColumnChartDataLabelsOverflow {
192175
}
193176

194177
// Refer to the issue https://github.com/AAChartModel/AAChartKit/issues/735
195-
- (AAOptions *)configureReversedBarChartDataLabelsStyle {
178+
+ (AAOptions *)configureReversedBarChartDataLabelsStyle {
196179
AAChartModel *aaChartModel = AAChartModel.new
197180
.chartTypeSet(AAChartTypeBar)
198181
.stackingSet(AAChartStackingTypeNormal)
@@ -223,7 +206,7 @@ - (AAOptions *)configureReversedBarChartDataLabelsStyle {
223206
}
224207

225208
//https://github.com/AAChartModel/AAChartKit/issues/1247
226-
- (AAOptions *)configureColumnChartDataLabelsLayout {
209+
+ (AAOptions *)configureColumnChartDataLabelsLayout {
227210
AAChartModel *aaChartModel = AAChartModel.new
228211
.chartTypeSet(AAChartTypeColumn)//图表类型
229212
.borderRadiusSet(@10)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// DrawChartWithAAOptionsComposer.h
3+
// AAChartKitDemo
4+
//
5+
6+
#import <Foundation/Foundation.h>
7+
#import "AAChartKit.h"
8+
9+
NS_ASSUME_NONNULL_BEGIN
10+
11+
@interface DrawChartWithAAOptionsComposer : NSObject
12+
13+
+ (AAOptions *)configureTheAAOptionsOfAreaChart;
14+
+ (AAOptions *)configureTheAAOptionsOfSpecialNestedColumnChart;
15+
+ (AAOptions *)configureTheNoGapColunmChart;
16+
+ (AAOptions *)adjustChartLeftAndRightMargin;
17+
+ (AAOptions *)configureChartWithBackgroundImage;
18+
+ (AAOptions *)adjustChartSeriesDataAccuracy;
19+
+ (AAOptions *)adjustGroupPaddingForPolarChart;
20+
+ (AAOptions *)customStyleStackedColumnChart;
21+
+ (AAOptions *)disableChartAnimation;
22+
+ (AAOptions *)customChartLengendItemStyle;
23+
+ (AAOptions *)yAxisOnTheRightSideChart;
24+
+ (AAOptions *)configure_DataLabels_XAXis_YAxis_Legend_Style;
25+
+ (AAOptions *)customChartStyleWhenNoData;
26+
+ (AAOptions *)customChartStyleWhenEveryDataValueIsZero;
27+
+ (AAOptions *)disableSpineChartHoverAnimationEffect;
28+
+ (AAOptions *)configureBoxplotChartWithSpecialStyle;
29+
+ (AAOptions *)toFixHighchartsWithAThickLineAt0ValuesTheLineIsHalfHidden;
30+
+ (AAOptions *)clipForAASeriesElement;
31+
+ (AAOptions *)configureDoubleYAxesAreasplineMixedColumnChart;
32+
33+
@end
34+
35+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)