Skip to content

Commit f193d96

Browse files
committed
Fix #519
1 parent 86d1e14 commit f193d96

6 files changed

Lines changed: 55 additions & 3 deletions

File tree

AAChartKitDemo/ChartsDemo/CustomStyleChartVC.m

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ - (AAChartModel *)setUpAAChartModelWithIndex:(NSUInteger)index {
109109
case 22: return [self configureQuadrangleRadarChart];
110110
case 23: return [self configurePentagonRadarChart];
111111
case 24: return [self configureHexagonRadarChart];
112+
case 25: return [self adjustYAxisMaxAndMinValues];
112113

113114
default:
114115
return nil;
@@ -856,6 +857,52 @@ - (AAChartModel *)configureHexagonRadarChart {
856857
]);
857858
}
858859

860+
- (AAChartModel *)adjustYAxisMaxAndMinValues {
861+
NSArray *categoriesArr = @[
862+
AAChartTypeColumn,
863+
AAChartTypeBar,
864+
AAChartTypeArea,
865+
AAChartTypeAreaspline,
866+
AAChartTypeLine,
867+
AAChartTypeSpline,
868+
AAChartTypeScatter,
869+
AAChartTypePie,
870+
AAChartTypeBubble,
871+
AAChartTypePyramid,
872+
AAChartTypeFunnel,
873+
AAChartTypeColumnrange,
874+
AAChartTypeArearange,
875+
AAChartTypeAreasplinerange,
876+
AAChartTypeBoxplot,
877+
AAChartTypeWaterfall,
878+
AAChartTypePolygon,
879+
];
880+
881+
return AAChartModel.new
882+
.chartTypeSet(AAChartTypeAreaspline)
883+
.titleSet(@"")
884+
.subtitleSet(@"")
885+
.legendEnabledSet(false)
886+
.yAxisVisibleSet(true)
887+
.easyGradientColorsSet(true)
888+
.zoomTypeSet(AAChartZoomTypeXY)
889+
.tooltipValueSuffixSet(@"kg")
890+
.categoriesSet(categoriesArr)
891+
.yAxisTitleSet(@"")
892+
.yAxisMinSet(@2.0)
893+
.yAxisMaxSet(@45.4)
894+
.xAxisTickIntervalSet(@2)
895+
.seriesSet(@[
896+
AASeriesElement.new
897+
.nameSet(@"体重")
898+
.colorSet(@"#2494F3")
899+
.dataSet(@[@7.0, @6.9, @2.5, @14.5, @18.2, @21.5, @5.2, @26.5, @23.3, @45.3, @13.9, @9.6])
900+
])
901+
;
902+
}
903+
904+
905+
859906

860907
@end
861908

AAChartKitDemo/ChartsDemo/FirstViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ - (NSArray *)chartTypeNameArr {
317317
@"Triangle Radar Chart---三角形雷达图",
318318
@"Quadrangle Radar Chart---四角形雷达图",
319319
@"Pentagon Radar Chart---五角形雷达图",
320-
@"Hexagon Radar Chart----六角形雷达图"
320+
@"Hexagon Radar Chart----六角形雷达图",
321+
@"adjustYAxisMaxAndMinValues----调整 X 轴和 Y 轴最大值"
321322
],
322323
/*混合类型图表*/
323324
@[@"Arearange Mixed Line---面积范围均线图",

AAChartKitLib/AAOptionsModel/AAXAxis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ AAPropStatementAndPropSetFuncStatement(strong, AAXAxis, AALabels *, labels) //
5555
AAPropStatementAndPropSetFuncStatement(assign, AAXAxis, BOOL , visible) //用于设置 x 轴以及 x 轴文字是否显示
5656
AAPropStatementAndPropSetFuncStatement(assign, AAXAxis, BOOL, opposite) //是否将坐标轴显示在对立面,默认情况下 x 轴是在图表的下方显示,y 轴是在左方,坐标轴显示在对立面后,x 轴是在上方显示,y 轴是在右方显示(即坐标轴会显示在对立面)。该配置一般是用于多坐标轴区分展示,另外在 Highstock 中,y 轴默认是在对立面显示的。 默认是:false.
5757
AAPropStatementAndPropSetFuncStatement(assign, AAXAxis, BOOL , startOnTick) //Whether to force the axis to start on a tick. Use this option with the minPadding option to control the axis start. 默认是:false.
58+
AAPropStatementAndPropSetFuncStatement(assign, AAXAxis, BOOL , endOnTick) //是否强制将坐标轴结束于刻度线,可以通过本属性及 maxPadding 来控制坐标轴的结束位置。 默认是:false.
5859
AAPropStatementAndPropSetFuncStatement(strong, AAXAxis, AACrosshair *, crosshair) //准星线样式设置
5960
AAPropStatementAndPropSetFuncStatement(copy, AAXAxis, NSString *, tickColor) //x轴轴线下方刻度线颜色
6061
AAPropStatementAndPropSetFuncStatement(strong, AAXAxis, NSNumber *, tickInterval) //x轴刻度点间隔数(设置每隔几个点显示一个 X轴的内容)

AAChartKitLib/AAOptionsModel/AAXAxis.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ - (instancetype)init {
5959
AAPropSetFuncImplementation(AAXAxis, BOOL , visible)
6060
AAPropSetFuncImplementation(AAXAxis, BOOL, opposite) //是否将坐标轴显示在对立面,默认情况下 x 轴是在图表的下方显示,y 轴是在左方,坐标轴显示在对立面后,x 轴是在上方显示,y 轴是在右方显示(即坐标轴会显示在对立面)。该配置一般是用于多坐标轴区分展示,另外在 Highstock 中,y 轴默认是在对立面显示的。 默认是:false.
6161
AAPropSetFuncImplementation(AAXAxis, BOOL , startOnTick) //Whether to force the axis to start on a tick. Use this option with the minPadding option to control the axis start. 默认是:false.
62+
AAPropSetFuncImplementation(AAXAxis, BOOL , endOnTick) //是否强制将坐标轴结束于刻度线,可以通过本属性及 maxPadding 来控制坐标轴的结束位置。 默认是:false.
6263
AAPropSetFuncImplementation(AAXAxis, AACrosshair*, crosshair) //准星线样式设置
6364
AAPropSetFuncImplementation(AAXAxis, NSString *, tickColor) //x轴轴线下方刻度线颜色
6465
AAPropSetFuncImplementation(AAXAxis, NSNumber *, tickInterval) //x轴刻度点间隔数(设置每隔几个点显示一个 X轴的内容)

AAChartKitLib/AAOptionsModel/AAYAxis.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ static AAYAxisGridLineInterpolation const AAYAxisGridLineInterpolationPolygon =
4040

4141
@interface AAYAxis : NSObject
4242

43-
//AAPropStatementAndPropSetFuncStatement(assign, AAYAxis, BOOL, min)
4443
AAPropStatementAndPropSetFuncStatement(strong, AAYAxis, AAAxisTitle *, title)
4544
AAPropStatementAndPropSetFuncStatement(strong, AAYAxis, NSArray *, plotBands)
4645
AAPropStatementAndPropSetFuncStatement(strong, AAYAxis, NSArray *, plotLines)
@@ -63,6 +62,8 @@ AAPropStatementAndPropSetFuncStatement(assign, AAYAxis, NSNumber *, min) //y轴
6362

6463
AAPropStatementAndPropSetFuncStatement(assign, AAYAxis, BOOL, visible) //y轴是否允许显示
6564
AAPropStatementAndPropSetFuncStatement(assign, AAYAxis, BOOL, opposite) //是否将坐标轴显示在对立面,默认情况下 x 轴是在图表的下方显示,y 轴是在左方,坐标轴显示在对立面后,x 轴是在上方显示,y 轴是在右方显示(即坐标轴会显示在对立面)。该配置一般是用于多坐标轴区分展示,另外在 Highstock 中,y 轴默认是在对立面显示的。 默认是:false.
65+
AAPropStatementAndPropSetFuncStatement(assign, AAYAxis, BOOL , startOnTick) //Whether to force the axis to start on a tick. Use this option with the minPadding option to control the axis start. 默认是:false.
66+
AAPropStatementAndPropSetFuncStatement(assign, AAYAxis, BOOL , endOnTick) //是否强制将坐标轴结束于刻度线,可以通过本属性及 maxPadding 来控制坐标轴的结束位置。 默认是:false.
6667
AAPropStatementAndPropSetFuncStatement(strong, AAYAxis, AACrosshair*, crosshair) //准星线样式设置
6768
AAPropStatementAndPropSetFuncStatement(strong, AAYAxis, AALabels *, stackLabels)
6869
AAPropStatementAndPropSetFuncStatement(strong, AAYAxis, NSNumber *, tickAmount)//刻度总数

AAChartKitLib/AAOptionsModel/AAYAxis.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ - (instancetype)init {
4242
return self;
4343
}
4444

45-
//AAPropSetFuncImplementation(AAYAxis, BOOL, min) tickWidth
4645
AAPropSetFuncImplementation(AAYAxis, AAAxisTitle *, title)
4746
AAPropSetFuncImplementation(AAYAxis, NSArray *, plotBands)
4847
AAPropSetFuncImplementation(AAYAxis, NSArray *, plotLines)
@@ -64,6 +63,8 @@ - (instancetype)init {
6463
//AAPropSetFuncImplementation(AAYAxis, NSNumber *, minPadding) //Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. This is useful when you don't want the lowest data value to appear on the edge of the plot area. 默认是:0.05.
6564
AAPropSetFuncImplementation(AAYAxis, BOOL, visible) //y轴是否允许显示
6665
AAPropSetFuncImplementation(AAYAxis, BOOL, opposite) //是否将坐标轴显示在对立面,默认情况下 x 轴是在图表的下方显示,y 轴是在左方,坐标轴显示在对立面后,x 轴是在上方显示,y 轴是在右方显示(即坐标轴会显示在对立面)。该配置一般是用于多坐标轴区分展示,另外在 Highstock 中,y 轴默认是在对立面显示的。 默认是:false.
66+
AAPropSetFuncImplementation(AAYAxis, BOOL , startOnTick) //Whether to force the axis to start on a tick. Use this option with the minPadding option to control the axis start. 默认是:false.
67+
AAPropSetFuncImplementation(AAYAxis, BOOL , endOnTick) //是否强制将坐标轴结束于刻度线,可以通过本属性及 maxPadding 来控制坐标轴的结束位置。 默认是:false.
6768
AAPropSetFuncImplementation(AAYAxis, AACrosshair*, crosshair) //准星线样式设置
6869
AAPropSetFuncImplementation(AAYAxis, AALabels *, stackLabels)
6970
AAPropSetFuncImplementation(AAYAxis, NSNumber *, tickAmount)//刻度总数

0 commit comments

Comments
 (0)