I'm using swift charts to make a line chart. I am drawing a circle on the last value, but I want to get the position of that circle so I can add an animation to it. Is this possible in charts?
func setupIntradayLine(data: [ChartDataEntry], percentChange: Double) -> LineChartDataSet {
let line = LineChartDataSet(entries: data)
line.colors = [.white]
line.lineWidth = 2.0
line.mode = .linear
line.drawHorizontalHighlightIndicatorEnabled = false
line.highlightColor = .softWhite
var colors = [UIColor]()
for i in 0..<data.count {
if(i == data.count - 1) {
colors.append(UIColor.white)
} else {
colors.append(UIColor.clear)
}
}
line.circleColors = colors
line.circleHoleRadius = 0
line.circleRadius = 3.5
line.drawCirclesEnabled = true
return line
}