Skip to content

Commit 667709b

Browse files
committed
Add a property named floating for AALegend and correct triple Y axes sample chart
1 parent ffb112e commit 667709b

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

AAChartKitDemo/ChartsDemo/DrawChartWithAAOptionsVC.m

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ - (void)setUpChartView {
6969

7070

7171
- (void)monitorTap {
72-
if (self.selectedIndex == 29) {
72+
if (self.selectedIndex == 30) {
7373
self.title = [NSString stringWithFormat:@"❗️This is the last chart❗️"];
7474
} else {
7575
self.selectedIndex = self.selectedIndex + 1;
@@ -1755,12 +1755,12 @@ - (AAOptions *)configureTripleYAxesMixedChart {
17551755
.enabledSet(true)//设置 y 轴是否显示数字
17561756
.formatSet(@"{value}°C")
17571757
.styleSet(AAStyle.new
1758-
.colorSet(colorsThemeArr[0])//yAxis Label font color
1758+
.colorSet(colorsThemeArr[2])//yAxis Label font color
17591759
))
17601760
.titleSet(AAAxisTitle.new
17611761
.textSet(@"温度")
17621762
.styleSet(AAStyle.new
1763-
.colorSet(colorsThemeArr[0])))
1763+
.colorSet(colorsThemeArr[2])))
17641764
.oppositeSet(true);
17651765

17661766

@@ -1771,12 +1771,12 @@ - (AAOptions *)configureTripleYAxesMixedChart {
17711771
.enabledSet(true)//设置 y 轴是否显示数字
17721772
.formatSet(@"{value}°mm")
17731773
.styleSet(AAStyle.new
1774-
.colorSet(colorsThemeArr[1])//yAxis Label font color
1774+
.colorSet(colorsThemeArr[0])//yAxis Label font color
17751775
))
17761776
.titleSet(AAAxisTitle.new
17771777
.textSet(@"降雨量")
17781778
.styleSet(AAStyle.new
1779-
.colorSet(colorsThemeArr[1])));
1779+
.colorSet(colorsThemeArr[0])));
17801780

17811781
AAYAxis *yAxis3 = AAYAxis.new
17821782
.visibleSet(true)
@@ -1785,19 +1785,21 @@ - (AAOptions *)configureTripleYAxesMixedChart {
17851785
.enabledSet(true)//设置 y 轴是否显示数字
17861786
.formatSet(@"{value}°mb")
17871787
.styleSet(AAStyle.new
1788-
.colorSet(colorsThemeArr[2])//yAxis Label font color
1788+
.colorSet(colorsThemeArr[1])//yAxis Label font color
17891789
))
1790-
.titleSet(AAAxisTitle.new
1790+
.titleSet(AAAxisTitle.new
17911791
.textSet(@"海平面气压")
17921792
.styleSet(AAStyle.new
1793-
.colorSet(colorsThemeArr[2])));
1794-
1793+
.colorSet(colorsThemeArr[1])))
1794+
.oppositeSet(true);
1795+
17951796
AATooltip *aaTooltip = AATooltip.new
17961797
.enabledSet(true)
17971798
.sharedSet(true);
17981799

17991800
AALegend *aaLegend = AALegend.new
18001801
.enabledSet(true)
1802+
.floatingSet(true)
18011803
.layoutSet(AAChartLayoutTypeVertical)
18021804
.alignSet(AAChartAlignTypeLeft)
18031805
.xSet(@80)

AAChartKitLib/AAOptionsModel/AALegend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ AAPropStatementAndPropSetFuncStatement(strong, AALegend, NSNumber *, symbolRa
5252
AAPropStatementAndPropSetFuncStatement(strong, AALegend, NSNumber *, symbolWidth)//图标宽度
5353
AAPropStatementAndPropSetFuncStatement(strong, AALegend, NSNumber *, x)
5454
AAPropStatementAndPropSetFuncStatement(strong, AALegend, NSNumber *, y)
55+
AAPropStatementAndPropSetFuncStatement(assign, AALegend, BOOL, floating)
56+
5557

5658
@end
5759

AAChartKitLib/AAOptionsModel/AALegend.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ @implementation AALegend
4949
AAPropSetFuncImplementation(AALegend, NSNumber *, symbolRadius)//图标圆角
5050
AAPropSetFuncImplementation(AALegend, NSNumber *, symbolWidth)//图标宽度
5151
AAPropSetFuncImplementation(AALegend, NSNumber *, x)
52-
AAPropSetFuncImplementation(AALegend, NSNumber *, y)
52+
AAPropSetFuncImplementation(AALegend, NSNumber *, y)
53+
AAPropSetFuncImplementation(AALegend, BOOL, floating)
5354

5455
@end
5556

0 commit comments

Comments
 (0)