Skip to content

Commit 940cb79

Browse files
committed
Optimize multiple attribute names for AAChartModel
1 parent bf1a25e commit 940cb79

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

AAInfographics/AAChartCreator/AAChartModel.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public enum AAChartFontWeightType: String {
121121
case thin, regular, bold
122122
}
123123

124-
public enum AALineDashStyleType: String {
124+
public enum AAChartLineDashStyleType: String {
125125
case solid
126126
case shortDash
127127
case shortDot
@@ -151,8 +151,9 @@ public class AAChartModel: AAObject {
151151
public var axesTextColor: String? //x 轴和 y 轴文字颜色
152152
public var chartType: AAChartType? //图表类型
153153
public var stacking: AAChartStackingType? //堆积样式
154-
public var symbol: AAChartSymbolType? //折线曲线连接点的类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
155-
public var symbolStyle: AAChartSymbolStyleType? //折线或者曲线的连接点是否为空心的
154+
public var markerRadius: Int? //折线连接点的半径长度
155+
public var markerSymbol: AAChartSymbolType? //折线曲线连接点的类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
156+
public var markerSymbolStyle: AAChartSymbolStyleType? //折线或者曲线的连接点是否为空心的
156157
public var zoomType: AAChartZoomType? //缩放类型 AAChartZoomTypeX表示可沿着 x 轴进行手势缩放
157158
public var inverted: Bool? //x 轴是否翻转(垂直)
158159
public var xAxisReversed: Bool? //x 轴翻转
@@ -186,7 +187,6 @@ public class AAChartModel: AAObject {
186187
public var legendEnabled: Bool? //是否显示图例
187188
public var backgroundColor: Any? //图表背景色
188189
public var borderRadius: Int? //柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效)
189-
public var markerRadius: Int? //折线连接点的半径长度
190190
public var touchEventEnabled: Bool? //是否支持触摸事件回调
191191

192192
@discardableResult
@@ -275,25 +275,25 @@ public class AAChartModel: AAObject {
275275

276276
@discardableResult
277277
public func symbol(_ prop: AAChartSymbolType) -> AAChartModel {
278-
symbol = prop
278+
markerSymbol = prop
279279
return self
280280
}
281281

282282
@discardableResult
283-
public func zoomType(_ prop: AAChartZoomType) -> AAChartModel {
284-
zoomType = prop
283+
public func symbolStyle(_ prop: AAChartSymbolStyleType) -> AAChartModel {
284+
markerSymbolStyle = prop
285285
return self
286286
}
287287

288288
@discardableResult
289-
public func inverted(_ prop: Bool) -> AAChartModel {
290-
inverted = prop
289+
public func zoomType(_ prop: AAChartZoomType) -> AAChartModel {
290+
zoomType = prop
291291
return self
292292
}
293293

294294
@discardableResult
295-
public func symbolStyle(_ prop: AAChartSymbolStyleType) -> AAChartModel {
296-
symbolStyle = prop
295+
public func inverted(_ prop: Bool) -> AAChartModel {
296+
inverted = prop
297297
return self
298298
}
299299

AAInfographics/AAChartCreator/AAOptionsConstructor.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ public class AAOptionsConstructor {
125125
|| chartType == .polygon {
126126
let aaMarker = AAMarker()
127127
.radius(aaChartModel.markerRadius) //曲线连接点半径,默认是4
128-
.symbol(aaChartModel.symbol?.rawValue) //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
129-
if (aaChartModel.symbolStyle == .innerBlank) {
128+
.symbol(aaChartModel.markerSymbol?.rawValue) //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
129+
if (aaChartModel.markerSymbolStyle == .innerBlank) {
130130
aaMarker
131131
.fillColor("#ffffff") //点的填充色(用来设置折线连接点的填充色)
132132
.lineWidth(2.0) //外沿线的宽度(用来设置折线连接点的轮廓描边的宽度)
133133
.lineColor("") //外沿线的颜色(用来设置折线连接点的轮廓描边颜色,当值为空字符串时,默认取数据点或数据列的颜色)
134-
} else if (aaChartModel.symbolStyle == .borderBlank) {
134+
} else if (aaChartModel.markerSymbolStyle == .borderBlank) {
135135
aaMarker
136136
.lineWidth(2.0)
137137
.lineColor(aaChartModel.backgroundColor)

AAInfographics/AAChartCreator/AASeriesElement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
}
125125

126126
@discardableResult
127-
public func dashStyle(_ prop: AALineDashStyleType) -> AASeriesElement {
127+
public func dashStyle(_ prop: AAChartLineDashStyleType) -> AASeriesElement {
128128
dashStyle = prop.rawValue
129129
return self
130130
}

AAInfographics/AAOptionsModel/AACrosshair.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class AACrosshair: AAObject {
3838
public var width: Float? //准星线宽度
3939

4040
@discardableResult
41-
public func dashStyle(_ prop: AALineDashStyleType) -> AACrosshair {
41+
public func dashStyle(_ prop: AAChartLineDashStyleType) -> AACrosshair {
4242
dashStyle = prop.rawValue
4343
return self
4444
}

AAInfographics/AAOptionsModel/AAPlotLinesElement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class AAPlotLinesElement: AAObject {
4747
}
4848

4949
@discardableResult
50-
public func dashStyle(_ prop: AALineDashStyleType) -> AAPlotLinesElement {
50+
public func dashStyle(_ prop: AAChartLineDashStyleType) -> AAPlotLinesElement {
5151
dashStyle = prop.rawValue
5252
return self
5353
}

AAInfographics/AAOptionsModel/AAYAxis.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class AAYAxis: AAObject {
4040
public var reversed: Bool?
4141
public var gridLineWidth: Float? // y 轴网格线宽度
4242
public var gridLineColor: String? // y 轴网格线颜色
43-
public var gridLineDashStyle: AALineDashStyleType? //网格线线条样式,所有可用的线条样式参考:Highcharts线条样式
43+
public var gridLineDashStyle: AAChartLineDashStyleType? //网格线线条样式,所有可用的线条样式参考:Highcharts线条样式
4444
public var alternateGridColor: String? //backcolor of every other grid line area
4545
public var gridLineInterpolation: String? //Polar charts only. Whether the grid lines should draw as a polygon with straight lines between categories, or as circles. Can be either circle or polygon. 默认是:null.
4646
public var labels: AALabels? //用于设置 y 轴文字相关的
@@ -104,7 +104,7 @@ public class AAYAxis: AAObject {
104104
}
105105

106106
@discardableResult
107-
public func gridLineDashStyle(_ prop: AALineDashStyleType?) -> AAYAxis {
107+
public func gridLineDashStyle(_ prop: AAChartLineDashStyleType?) -> AAYAxis {
108108
gridLineDashStyle = prop
109109
return self
110110
}

AAInfographicsDemo/Demo/AdditionalContent/DoubleChartsLinkedWorkVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class DoubleChartsLinkedWorkVC: UIViewController, AAChartViewDelegate {
8484
let aaOptions = AAOptionsConstructor.configureChartOptions(aaChartModel1)
8585
aaOptions.xAxis?
8686
.crosshair(AACrosshair()
87-
.dashStyle(AALineDashStyleType.longDashDot)
87+
.dashStyle(AAChartLineDashStyleType.longDashDot)
8888
.color(AAColor.black)
8989
.width(1)
9090
)

AAInfographicsDemo/Demo/CustomStyleChartVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class CustomStyleChartVC: UIViewController {
244244
.color(AAGradientColor.freshPapaya)
245245
.lineWidth(5)
246246
.zones([["value": 8],
247-
["dashStyle": AALineDashStyleType.dot.rawValue]
247+
["dashStyle": AAChartLineDashStyleType.dot.rawValue]
248248
]),
249249
AASeriesElement()
250250
.name("所有专业")

0 commit comments

Comments
 (0)