I draw a line chart and I have a vertical line
there is a way with this library to add a dot on vertical line and when I press and move the line, the dot move across that line chart (i add a picture)
I'm using this library https://github.com/danielgindi/Chart to get line charts
my function :
func setData() {
let dataSet = LineChartDataSet(entries: ChartLineHandler.getChartData())
dataSet.mode = .cubicBezier
dataSet.lineWidth = 1
dataSet.drawHorizontalHighlightIndicatorEnabled = false
dataSet.setColor(.systemOrange)
dataSet.drawCirclesEnabled = false
let data = LineChartData(dataSet: dataSet)
data.setDrawValues(false)
lineChatView.data = data
}
You need to create the Marker:
Then add it to your Chart View:
Don't forget to enable highlightPerDragEnabled and highlightPerTapEnabled: