AAChartKit-Swift
AAChartKit-Swift copied to clipboard
Opacity on scroll don't work
I have configured charts, but when scrolling left, opacity not working on charts out of grid. It is still visible
let chartView = AAChartView() chartView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: chartViewContainer.frame.size.height) chartView.isClearBackgroundColor = true chartView.delegate = presenter as? AAChartViewDelegate chartViewContainer.addSubview(chartView) chartView.isScrollEnabled = false let scrollSize = dates.count / 4 * Int(UIScreen.main.bounds.width)
let chartModel = AAChartModel()
.chartType(.line)
.legendEnabled(false)
.backgroundColor("#031827")
.dataLabelsEnabled(true)
.dataLabelsStyle(
AAStyle()
.borderRadius(0)
.width(0)
.color(AAColor.white)
.textOutline(AAColor.clear)
.fontSize(13)
)
.xAxisLabelsStyle(
AAStyle()
.lineWidth(0.5)
.fontWeight(
AAChartFontWeightType.thin
)
)
.markerSymbol(.circle)
.markerRadius(3)
.markerSymbolStyle(.innerBlank)
.colorsTheme([AAColor.gray])
.yAxisLineWidth(0.3)
.xAxisVisible(true)
.yAxisVisible(true)
.xAxisReversed(true)
.xAxisTickInterval(1)
.yAxisTitle("Group Size")
.tooltipEnabled(false)
.xAxisGridLineWidth(0.3)
.yAxisGridLineWidth(0.3)
.xAxisLabelsEnabled(true)
.scrollablePlotArea(
AAScrollablePlotArea()
.minWidth(scrollSize)
.scrollPositionX(0)
.opacity(0)
)
.animationType(.bounce)
.categories(strDates)
.series([
AASeriesElement()
.data(modifiedValues as [Any])
.dashStyle(AAChartLineDashStyleType.solid)
])
chartView.aa_drawChartWithChartModel(chartModel)
chartView.aa_updateXAxisCategories(strDates)