Skip to content

Commit d7a0dbb

Browse files
committed
Fix #242 => Add AABubble for AAPlotOptions
1 parent 5acd19d commit d7a0dbb

File tree

2 files changed

+69
-13
lines changed

2 files changed

+69
-13
lines changed

AAInfographics/AAChartCreator/AASeriesElement.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@
5252
public var colorByPoint: Bool? //When using automatic point colors pulled from the `options.colors` collection, this option determines whether the chart should receive one color per series or one color per point.
5353
public var allowPointSelect: Bool? //Allow this series' points to be selected by clicking on the markers, bars or pie slices
5454
public var zIndex: Int? //Define the visual z index of the series.
55-
public var size: Any? //The innder size for pie chart
56-
public var innerSize: String? //The innder size for pie chart
55+
public var size: Any? //The innder size for pie chart (String | Number)
56+
public var innerSize: Any? //The innder size for pie chart (String | Number)
57+
public var minSize: Any? //The minimum size for a pie in response to auto margins, Only useful for pie, bubble, funnel, Pyramid (String | Number)
5758
public var shadow: AAShadow?
5859
public var zones: [AAZonesElement]?
5960
public var zoneAxis: String? //Defines the Axis on which the zones are applied. defalut value:y.
@@ -197,11 +198,17 @@
197198
}
198199

199200
@discardableResult
200-
public func innerSize(_ prop: String) -> AASeriesElement {
201+
public func innerSize(_ prop: Any) -> AASeriesElement {
201202
innerSize = prop
202203
return self
203204
}
204205

206+
@discardableResult
207+
public func minSize(_ prop: Any) -> AASeriesElement {
208+
minSize = prop
209+
return self
210+
}
211+
205212
@discardableResult
206213
public func shadow(_ prop: AAShadow) -> AASeriesElement {
207214
shadow = prop

AAInfographics/AAOptionsModel/AAPlotOptions.swift

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class AAPlotOptions: AAObject {
4040
public var area: AAArea?
4141
public var areaspline: AAAreaspline?
4242
public var pie: AAPie?
43+
public var bubble: AABubble?
4344
public var columnrange: AAColumnrange?
4445
public var arearange: AAArearange?
4546
public var series: AASeries?
@@ -51,20 +52,14 @@ public class AAPlotOptions: AAObject {
5152
}
5253

5354
@discardableResult
54-
public func line(_ prop: AALine) -> AAPlotOptions {
55-
line = prop
56-
return self
57-
}
58-
59-
@discardableResult
60-
public func pie(_ prop: AAPie) -> AAPlotOptions {
61-
pie = prop
55+
public func bar(_ prop: AABar) -> AAPlotOptions {
56+
bar = prop
6257
return self
6358
}
6459

6560
@discardableResult
66-
public func bar(_ prop: AABar) -> AAPlotOptions {
67-
bar = prop
61+
public func line(_ prop: AALine) -> AAPlotOptions {
62+
line = prop
6863
return self
6964
}
7065

@@ -86,6 +81,18 @@ public class AAPlotOptions: AAObject {
8681
return self
8782
}
8883

84+
@discardableResult
85+
public func pie(_ prop: AAPie) -> AAPlotOptions {
86+
pie = prop
87+
return self
88+
}
89+
90+
@discardableResult
91+
public func bubble(_ prop: AABubble) -> AAPlotOptions {
92+
bubble = prop
93+
return self
94+
}
95+
8996
@discardableResult
9097
public func columnrange(_ prop: AAColumnrange) -> AAPlotOptions {
9198
columnrange = prop
@@ -449,6 +456,48 @@ public class AAPie: AAObject {
449456

450457
}
451458

459+
public class AABubble: AAObject {
460+
public var minSize: Float?
461+
public var maxSize: Float?
462+
public var zMin: Float?
463+
public var zMax: Float?
464+
public var dataLabels:AADataLabels?
465+
466+
@discardableResult
467+
public func minSize(_ prop: Float?) -> AABubble {
468+
minSize = prop
469+
return self
470+
}
471+
472+
@discardableResult
473+
public func maxSize(_ prop: Float?) -> AABubble {
474+
maxSize = prop
475+
return self
476+
}
477+
478+
@discardableResult
479+
public func zMin(_ prop: Float?) -> AABubble {
480+
zMin = prop
481+
return self
482+
}
483+
484+
@discardableResult
485+
public func zMax(_ prop: Float?) -> AABubble {
486+
zMax = prop
487+
return self
488+
}
489+
490+
@discardableResult
491+
public func dataLabels(_ prop: AADataLabels?) -> AABubble {
492+
dataLabels = prop
493+
return self
494+
}
495+
496+
public override init() {
497+
498+
}
499+
}
500+
452501
public class AAColumnrange: AAObject {
453502
public var borderRadius: Float?//The color of the border surrounding each column or bar
454503
public var borderWidth: Float?//The corner radius of the border surrounding each column or bar. default:0

0 commit comments

Comments
 (0)