-
-
Notifications
You must be signed in to change notification settings - Fork 263
Open
Labels
Description
大佬,有几个曲线图的问题想咨询啊
- 曲线是否能从纵轴开始画曲线过去啊?
- 曲线可以如图红色的线,可以从最顶部直接画线到第一个x轴的坐标呢?
- 当我设置最大值aaOptions.yAxis?.max = 100时,我这个顶部的曲线少了一半的高度私的。
求教啊,下面是我的代码
private func drawChart() {
let gradientColor = AAGradientColor.linearGradient(
direction: .toBottom,
startColor: kHexColor("#00AEEF").toRGBAString(alpha: 0.4),
endColor: kHexColor("#00AEEF").toRGBAString(alpha: 0.0)
)
let chartModel = AAChartModel()
.chartType(.areaspline)
.backgroundColor("#FAFAFA")
// .animationDuration(0)
.title("")
.subtitle("")
.categories(xArr)
.xAxisLabelsStyle(AAStyle()
.color(AAColor.black)
.fontSize(10)
.fontWeight(.bold))
.yAxisLabelsStyle(AAStyle()
.color(AAColor.black)
.fontSize(10)
.fontWeight(.bold)
)
.legendEnabled(false)
.tooltipValueSuffix("")
.series([
AASeriesElement()
.name("SOH(%)")
.color("#24C7C7")
.fillColor(gradientColor)
.lineWidth(2)
.marker(AAMarker()
.radius(2)
.symbol(.circle))
.data(yArr)
])
// 2. 转为 AAOptions,修改 tickAmount
let aaOptions = AAOptionsConstructor.configureChartOptions(chartModel)
aaOptions.yAxis?.tickAmount = 1
aaOptions.yAxis?.max = 100
aaOptions.yAxis?.min = 0
aaOptions.yAxis?.gridLineDashStyle(.dash)
aaOptions.yAxis?.lineWidth = 1
// 3. 渲染图表
chartView.scrollEnabled = false
chartView.aa_drawChartWithChartOptions(aaOptions)
}


