Skip to content

Commit 91b9c42

Browse files
committed
Add AAOptionsListVC; update MainVC and AABaseListVC
Introduce AAOptionsListVC (header & implementation) and register it in the Xcode project.pbxproj. Move the AAOptions / DrawChartWithAAOptions entry into its own list VC and remove the previous inline handling from MainVC, adjusting subsequent case indices and the section list accordingly. Improve AABaseListVC: only set default title when empty and split cell title strings on '---' to populate titleLabel and subtitleLabel (trimmed subtitle support). These changes organize AAOptions routes and improve table cell presentation.
1 parent 439ca73 commit 91b9c42

5 files changed

Lines changed: 126 additions & 58 deletions

File tree

AAChartKitDemo.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
84526E202CEED3F100EB2563 /* JSFunctionBeforeAndAfterRenderingComposer6.m in Sources */ = {isa = PBXBuildFile; fileRef = 84526E1F2CEED3F100EB2563 /* JSFunctionBeforeAndAfterRenderingComposer6.m */; };
118118
84526E232CEF256C00EB2563 /* TripleChartsLinkedWorkVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 84526E212CEF256C00EB2563 /* TripleChartsLinkedWorkVC.m */; };
119119
845589C928C3B27C009D1BC3 /* AAScatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 845589C828C3B27C009D1BC3 /* AAScatter.m */; };
120+
84565CCB2F6920CB00E47891 /* AAOptionsListVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 84565CCA2F6920CB00E47891 /* AAOptionsListVC.m */; };
120121
845F42912E8BE1BA00CE65AB /* AAJsonConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 845F42902E8BE1BA00CE65AB /* AAJsonConverter.m */; };
121122
845FC2392EA0CF67002FC670 /* JSFunctionBeforeAndAfterRenderingComposer7.m in Sources */ = {isa = PBXBuildFile; fileRef = 845FC2382EA0CF67002FC670 /* JSFunctionBeforeAndAfterRenderingComposer7.m */; };
122123
846141F72C86FC0F0032FBD3 /* JSFunctionForAAChartEventsVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 846141F62C86FC0F0032FBD3 /* JSFunctionForAAChartEventsVC.m */; };
@@ -423,6 +424,8 @@
423424
84526E222CEF256C00EB2563 /* TripleChartsLinkedWorkVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TripleChartsLinkedWorkVC.h; sourceTree = "<group>"; };
424425
845589C728C3B27C009D1BC3 /* AAScatter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AAScatter.h; sourceTree = "<group>"; };
425426
845589C828C3B27C009D1BC3 /* AAScatter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AAScatter.m; sourceTree = "<group>"; };
427+
84565CC92F6920CB00E47891 /* AAOptionsListVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AAOptionsListVC.h; sourceTree = "<group>"; };
428+
84565CCA2F6920CB00E47891 /* AAOptionsListVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AAOptionsListVC.m; sourceTree = "<group>"; };
426429
845F428F2E8BE1BA00CE65AB /* AAJsonConverter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AAJsonConverter.h; sourceTree = "<group>"; };
427430
845F42902E8BE1BA00CE65AB /* AAJsonConverter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AAJsonConverter.m; sourceTree = "<group>"; };
428431
845FC2372EA0CF67002FC670 /* JSFunctionBeforeAndAfterRenderingComposer7.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSFunctionBeforeAndAfterRenderingComposer7.h; sourceTree = "<group>"; };
@@ -900,6 +903,8 @@
900903
713F54381E7B71C000D506C7 /* MainVC.m */,
901904
8461422E2C8AF5320032FBD3 /* AAChartModelListVC.h */,
902905
8461422F2C8AF5320032FBD3 /* AAChartModelListVC.m */,
906+
84565CC92F6920CB00E47891 /* AAOptionsListVC.h */,
907+
84565CCA2F6920CB00E47891 /* AAOptionsListVC.m */,
903908
846142072C88330C0032FBD3 /* AAOptionsWithJSForChartEventsListVC.h */,
904909
846142082C88330C0032FBD3 /* AAOptionsWithJSForChartEventsListVC.m */,
905910
85A0C0322F5A300100AA0001 /* AAOptionsComposerChartListVC.h */,
@@ -1522,6 +1527,7 @@
15221527
1E66D208210AF4ED007EAB8C /* AAPlotLinesElement.m in Sources */,
15231528
64AF87601F0A981400A801C4 /* OnlyRefreshChartDataVC.m in Sources */,
15241529
7172A3DB1E763EA6000D5B99 /* AppDelegate.m in Sources */,
1530+
84565CCB2F6920CB00E47891 /* AAOptionsListVC.m in Sources */,
15251531
8492D9B52C81A321007EB8D0 /* AAChartViewManager.m in Sources */,
15261532
440B098024C189950056CE08 /* AACredits.m in Sources */,
15271533
27E38C651F0E47BA00FB52E1 /* ChartAnimationTypeVC.m in Sources */,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// AAOptionsListVC.h
3+
// AAChartKitDemo
4+
//
5+
// Created by AnAn on 2026/3/17.
6+
// Copyright © 2026 An An. All rights reserved.
7+
//
8+
9+
#import "AABaseListVC.h"
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface AAOptionsListVC : AABaseListVC
14+
15+
@end
16+
17+
NS_ASSUME_NONNULL_END
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//
2+
// AAOptionsListVC.m
3+
// AAChartKitDemo
4+
//
5+
// Created by AnAn on 2026/3/17.
6+
// Copyright © 2026 An An. All rights reserved.
7+
//
8+
9+
#import "AAOptionsListVC.h"
10+
#import "DrawChartWithAAOptionsVC.h"
11+
12+
@interface AAOptionsListVC ()
13+
14+
@end
15+
16+
@implementation AAOptionsListVC
17+
18+
- (void)viewDidLoad {
19+
[super viewDidLoad];
20+
// Do any additional setup after loading the view.
21+
22+
self.title = @"AAOptions";
23+
self.sectionTitleArr = @[
24+
@"Draw Chart With AAOptions---通过Options绘图",
25+
];
26+
27+
self.chartTypeTitleArr = @[
28+
@[
29+
@"configureTheAAOptionsOfAreaChart---绘制legend居顶部的区域填充图",
30+
@"configureTheAAOptionsOfSpecialNestedColumnChart---绘制嵌套的柱状图",
31+
@"configureTheNoGapColumnChart---缝隙很小的柱状图",
32+
@"adjustChartLeftAndRightMargin---调整图表的左右边距",
33+
@"configureChartWithBackgroundImage---设置图表绘图区的背景图片",
34+
@"Adjust Data Accuracy---调整数据精度",
35+
@"Custom Style Stacked Column---自定义堆积柱状图",
36+
@"Disable Animation ---禁用动画效果",
37+
@"Custom Legend Item Style---自定义图例样式",
38+
@"configure_DataLabels_XAXis_YAxis_Legend_Style---配置DataLabels、XAXis、YAxis、Legend等图表元素样式",
39+
@"custom Chart Style When No Data---数据为空的情况下,配置图表的 x 轴 y 轴等样式",
40+
@"custom Chart Style When Every Data Value Is 0---所有数据都为 0 的情况下, 配置图表的 x 轴 y 轴等样式",
41+
@"disable Spline Chart Hover Animation Effect---禁用手指点击曲线或者掠过曲线后,曲线变粗的动画效果",
42+
@"yAxisOnTheRightSideChart---y轴在右侧的图表",
43+
@"configureBoxplotChartWithSpecialStyle---配置盒须图特殊样式",
44+
@"toFixHighchartsWithAThickLineAt0ValuesTheLineIsHalfHidden---修复 Highcharts 在数值为 0 的时候,线条会变粗,但是却被遮挡一半的问题",
45+
@"clipForAASeriesElement---修复线条贴边时,但是却被遮挡一半的问题"
46+
],
47+
];
48+
49+
[self setUpMainTableView];
50+
}
51+
52+
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
53+
NSUInteger row = (NSUInteger)indexPath.row;
54+
55+
DrawChartWithAAOptionsVC *vc = DrawChartWithAAOptionsVC.new;
56+
vc.selectedIndex = row;
57+
vc.navigationItemTitleArr = self.chartTypeTitleArr[indexPath.section];
58+
vc.hidesBottomBarWhenPushed = YES;
59+
[self.navigationController pushViewController:vc animated:YES];
60+
}
61+
62+
/*
63+
#pragma mark - Navigation
64+
65+
// In a storyboard-based application, you will often want to do a little preparation before navigation
66+
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
67+
// Get the new view controller using [segue destinationViewController].
68+
// Pass the selected object to the new view controller.
69+
}
70+
*/
71+
72+
@end

AAChartKitDemo/Demo/AAChartListVC/MainVC.m

Lines changed: 24 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#import "MainVC.h"
3636
#import "OnlyRefreshChartDataVC.h"
3737
#import "ChartAnimationTypeVC.h"
38-
#import "DrawChartWithAAOptionsVC.h"
3938
#import "ShowManyChartViewVC.h"
4039
#import "ChartListVC.h"
4140
#import "HideOrShowChartSeriesVC.h"
@@ -213,16 +212,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
213212
break;
214213

215214
case 2: {
216-
/*通过AAOptions实例对象来绘制图形*/
217-
DrawChartWithAAOptionsVC *vc = DrawChartWithAAOptionsVC.new;
218-
vc.selectedIndex = row;
219-
vc.navigationItemTitleArr = self.chartTypeNameArr[section];
220-
vc.hidesBottomBarWhenPushed = YES;
221-
[self.navigationController pushViewController:vc animated:YES];
222-
}
223-
break;
224-
225-
case 3: {
226215
/*同时显示多个 AAChartView*/
227216
if (row == 0) {
228217
ShowManyChartViewVC *vc = ShowManyChartViewVC.new;
@@ -248,15 +237,15 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
248237
}
249238
break;
250239

251-
case 4: {
240+
case 3: {
252241
HideOrShowChartSeriesVC *vc = HideOrShowChartSeriesVC.new;
253242
vc.chartTypeIndex = row;
254243
vc.hidesBottomBarWhenPushed = YES;
255244
[self.navigationController pushViewController:vc animated:YES];
256245
}
257246
break;
258247

259-
case 5: {
248+
case 4: {
260249
JSFunctionForAATooltipVC *vc = JSFunctionForAATooltipVC.new;
261250
vc.selectedIndex = row;
262251
vc.navigationItemTitleArr = self.chartTypeNameArr[section];
@@ -265,7 +254,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
265254
}
266255
break;
267256

268-
case 6: {
257+
case 5: {
269258
/*基础类型图表*/
270259
EvaluateJSStringFunctionVC *vc = EvaluateJSStringFunctionVC.new;
271260
vc.sampleChartTypeIndex = row;
@@ -274,7 +263,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
274263
}
275264
break;
276265

277-
case 7: {
266+
case 6: {
278267
/*基础类型图表*/
279268
ScrollingUpdateDataVC *vc = ScrollingUpdateDataVC.new;
280269
vc.selectedIndex = row;
@@ -284,7 +273,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
284273
}
285274
break;
286275

287-
case 8: {
276+
case 7: {
288277
/*基础类型图表*/
289278
DrawableChartVC *vc = DrawableChartVC.new;
290279
vc.selectedIndex = row;
@@ -296,7 +285,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
296285
}
297286
break;
298287

299-
case 9: {
288+
case 8: {
300289
/*基础类型图表*/
301290
DrawableChartVC *vc = DrawableChartVC.new;
302291
vc.selectedIndex = row;
@@ -308,7 +297,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
308297
}
309298
break;
310299

311-
case 10: {
300+
case 9: {
312301
/*基础类型图表*/
313302
DataSortingWithAnimationChartVC *vc = DataSortingWithAnimationChartVC.new;
314303
vc.selectedIndex = row;
@@ -318,7 +307,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
318307
}
319308
break;
320309

321-
case 11: {
310+
case 10: {
322311
/*基础类型图表*/
323312
ChartAdvancedUpdatingFeatureVC *vc = ChartAdvancedUpdatingFeatureVC.new;
324313
vc.chartType = row;
@@ -327,15 +316,15 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
327316
}
328317
break;
329318

330-
case 12: {
319+
case 11: {
331320
/*在 XIB 中创建 AAChartView*/
332321
TestAAChartViewForXibVC *vc = TestAAChartViewForXibVC.new;
333322
vc.hidesBottomBarWhenPushed = YES;
334323
[self.navigationController pushViewController:vc animated:YES];
335324
}
336325
break;
337326

338-
case 13: {
327+
case 12: {
339328
/*通过 AAOptions 自定义饼图"*/
340329
PieChartOptionsVC *vc = PieChartOptionsVC.new;
341330
vc.selectedIndex = row;
@@ -345,7 +334,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
345334
}
346335
break;
347336

348-
case 14: {
337+
case 13: {
349338
/*通过 AAOptions 自定义极地图"*/
350339
PolarChartOptionsVC *vc = PolarChartOptionsVC.new;
351340
vc.selectedIndex = row;
@@ -355,7 +344,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
355344
}
356345
break;
357346

358-
case 15: {
347+
case 14: {
359348
/*通过 AAOptions 自定义多 Y 轴图表"*/
360349
MultiYAxesChartOptionsVC *vc = MultiYAxesChartOptionsVC.new;
361350
vc.selectedIndex = row;
@@ -365,7 +354,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
365354
}
366355
break;
367356

368-
case 16: {
357+
case 15: {
369358
/*颜色线-颜色带-值颜色分区图表"*/
370359
PlotLinesBandsZonesOptionsVC *vc = PlotLinesBandsZonesOptionsVC.new;
371360
vc.selectedIndex = row;
@@ -375,7 +364,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
375364
}
376365
break;
377366

378-
case 17: {
367+
case 16: {
379368
/*通过 AAOptions 自定义饼图"*/
380369
AreasplineChartOptionsVC *vc = AreasplineChartOptionsVC.new;
381370
vc.selectedIndex = row;
@@ -385,7 +374,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
385374
}
386375
break;
387376

388-
case 18: {
377+
case 17: {
389378
/*通过 AAOptions 自定义 tooltip 浮动提示框*/
390379
TooltipOptionsVC *vc = TooltipOptionsVC.new;
391380
vc.selectedIndex = row;
@@ -395,7 +384,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
395384
}
396385
break;
397386

398-
case 19: {
387+
case 18: {
399388
/*通过 AAOptions 自定义 DataLabels 数据标签*/
400389
DataLabelsOptionsVC *vc = DataLabelsOptionsVC.new;
401390
vc.selectedIndex = row;
@@ -405,7 +394,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
405394
}
406395
break;
407396

408-
case 20: {
397+
case 19: {
409398
/*通过 AAOptions 自定义 X 轴 Y 轴的文字标签*/
410399
XAxisYAxisLabelsOptionsVC *vc = XAxisYAxisLabelsOptionsVC.new;
411400
vc.selectedIndex = row;
@@ -415,7 +404,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
415404
}
416405
break;
417406

418-
case 21: {
407+
case 20: {
419408
/*通过 AAOptions 自定义 X 轴 Y 轴的轴类型*/
420409
XAxisYAxisTypeOptionsVC *vc = XAxisYAxisTypeOptionsVC.new;
421410
vc.selectedIndex = row;
@@ -424,7 +413,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
424413
[self.navigationController pushViewController:vc animated:YES];
425414
}
426415
break;
427-
case 22: {
416+
case 21: {
428417
/*通过 AAOptions 自定义 X 轴 Y 轴的 Labels*/
429418
JSFunctionForAAAxisVC *vc = JSFunctionForAAAxisVC.new;
430419
vc.selectedIndex = row;
@@ -433,7 +422,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
433422
[self.navigationController pushViewController:vc animated:YES];
434423
}
435424
break;
436-
case 23: {
425+
case 22: {
437426
/*通过 AAOptions 自定义 AALegend*/
438427
JSFunctionForAALegendVC *vc = JSFunctionForAALegendVC.new;
439428
vc.selectedIndex = row;
@@ -442,7 +431,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
442431
[self.navigationController pushViewController:vc animated:YES];
443432
}
444433
break;
445-
case 24: {
434+
case 23: {
446435
/*通过 AAOptions 自定义 AAChartEvents*/
447436
JSFunctionForAAChartEventsVC *vc = JSFunctionForAAChartEventsVC.new;
448437
vc.selectedIndex = row;
@@ -452,7 +441,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
452441
}
453442
break;
454443

455-
case 25: {
444+
case 24: {
456445
/*通过 AAOptions 自定义折线图*/
457446
LineChartViewController *vc = LineChartViewController.new;
458447
vc.selectedIndex = row;
@@ -462,7 +451,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
462451
}
463452
break;
464453

465-
case 26: {
454+
case 25: {
466455
/*完全自定义图表交互事件回调的信息*/
467456
if (row == 0) {
468457
CustomClickEventCallbackMessageVC *vc = CustomClickEventCallbackMessageVC.new;
@@ -480,7 +469,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
480469
}
481470
break;
482471

483-
case 27: {
472+
case 26: {
484473
/*AAOptions Composer Provider 测试入口*/
485474
AAOptionsComposerChartListVC *vc = AAOptionsComposerChartListVC.new;
486475
vc.hidesBottomBarWhenPushed = YES;
@@ -499,7 +488,6 @@ - (NSArray *)sectionTypeArr {
499488
_sectionTypeArr = @[
500489
@"Only Refresh data---单纯刷新数据",
501490
@"Animation Type---渲染动画",
502-
@"Draw Chart With AAOptions---通过Options绘图",
503491
@"Many ChartView simultaneously---同时显示多个AAChartView",
504492
@"Hide Or Show Chart Series---隐藏或显示内容",
505493
@"JS Function For AATooltip---支持 JS 函数属性",
@@ -556,25 +544,6 @@ - (NSArray *)chartTypeNameArr {
556544
@"Scatter Chart---散点图",
557545
@"Pie Chart---扇形图"
558546
],
559-
/*通过AAOptions实例对象来绘制图形*/
560-
@[@"configureTheAAOptionsOfAreaChart---绘制legend居顶部的区域填充图",
561-
@"configureTheAAOptionsOfSpecialNestedColumnChart---绘制嵌套的柱状图",
562-
@"configureTheNoGapColumnChart---缝隙很小的柱状图",
563-
@"adjustChartLeftAndRightMargin---调整图表的左右边距",
564-
@"configureChartWithBackgroundImage---设置图表绘图区的背景图片",
565-
@"Adjust Data Accuracy---调整数据精度",
566-
@"Custom Style Stacked Column---自定义堆积柱状图",
567-
@"Disable Animation ---禁用动画效果",
568-
@"Custom Legend Item Style---自定义图例样式",
569-
@"configure_DataLabels_XAXis_YAxis_Legend_Style---配置DataLabels、XAXis、YAxis、Legend等图表元素样式",
570-
@"custom Chart Style When No Data---数据为空的情况下,配置图表的 x 轴 y 轴等样式",
571-
@"custom Chart Style When Every Data Value Is 0---所有数据都为 0 的情况下, 配置图表的 x 轴 y 轴等样式",
572-
@"disable Spline Chart Hover Animation Effect---禁用手指点击曲线或者掠过曲线后,曲线变粗的动画效果",
573-
@"yAxisOnTheRightSideChart---y轴在右侧的图表",
574-
@"configureBoxplotChartWithSpecialStyle---配置盒须图特殊样式",
575-
@"toFixHighchartsWithAThickLineAt0ValuesTheLineIsHalfHidden---修复 Highcharts 在数值为 0 的时候,线条会变粗,但是却被遮挡一半的问题",
576-
@"clipForAASeriesElement---修复线条贴边时,但是却被遮挡一半的问题"
577-
],
578547
/*同时显示多个 AAChartView*/
579548
@[@"Show Two AAChartView On View---同时显示多个 AAChartView",
580549
@"Show Many AAChartView On UITableView---UITableView上显示多个 AAChartView",

0 commit comments

Comments
 (0)