Skip to content

Commit 2dde8e1

Browse files
committed
Fix #537
1 parent ec6e013 commit 2dde8e1

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

AAInfographicsDemo/Demo/AAOptionsWithJS/AAMixedChartComposer.swift

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ class AAMixedChartComposer {
2222
"capHeight": 32 as Float,
2323
"capWidth": 2 as Float
2424
]
25-
26-
let YAxis = [
27-
"min": 0 as Double,
28-
"max": 100 as Double,
29-
"tickInterval": 10 as Float
30-
] as [String : Any]
3125

3226
// 原始数据
3327
let sleepData = [
@@ -45,14 +39,6 @@ class AAMixedChartComposer {
4539
]
4640
]
4741

48-
/**
49-
// 数据处理函数
50-
function createCategories() {
51-
return sleepData.ideal.map(item => item.category);
52-
}
53-
54-
*/
55-
5642
// 数据处理函数
5743
func createCategories() -> [String] {
5844
return sleepData["ideal"]!.map { item in
@@ -153,27 +139,29 @@ class AAMixedChartComposer {
153139
.plotLines(createPlotLines())
154140

155141
let aaYAxis = AAYAxis()
156-
.min(YAxis["min"] as! Double)
157-
.max(YAxis["max"] as! Double)
158-
.tickInterval(YAxis["tickInterval"] as! Float)
159-
.title(nil)
142+
.min(0)
143+
.max(100)
144+
.title(AATitle()
145+
.text("")) // 设置 y 轴标题为空
160146
.gridLineWidth(0)
161-
.labels(AALabels().enabled(false))
147+
.labels(AALabels()
148+
.enabled(false))
162149

163150
let aaPlotOptions = AAPlotOptions()
164151
.bar(AABar()
165152
.grouping(false)
166153
.borderWidth(0)
167154
.pointWidth(Dimensions["pointWidth"] as! Float)
168-
.dataLabels(AADataLabels().enabled(false)))
155+
.dataLabels(AADataLabels()
156+
.enabled(false)))
169157
.boxplot(AABoxplot()
170158
.grouping(false)
171159
.lineWidth(0)
172160
.medianWidth(0)
173161
.medianColor("transparent")
174162
.stemWidth(0)
175-
// .pointWidth(Dimensions["pointWidth"] as! Float)
176-
// .whiskerLength(Dimensions["capHeight"] as! Float)
163+
.pointWidth(Dimensions["pointWidth"] as! Float)
164+
.whiskerLength(Dimensions["capHeight"] as! Float)
177165
.whiskerWidth(Dimensions["capWidth"] as! Float)
178166
.whiskerColor("transparent"))
179167

0 commit comments

Comments
 (0)