I am adding on marker on tap using iOS charts. I want to open the marker only if value is not zero. Can we do this using iOS Charts library.
Asked
Active
Viewed 1,341 times
3
-
can you share the code you have? – DevB2F May 17 '18 at 14:27
1 Answers
8
First set the delegate of barChartView and then in chartValueSelected function write this code
func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight){
if entry.y == 0.0{
barChartView.highlightValue(nil, callDelegate: false)
}
}
wherever you need to hide the marker just add this code
barChartView.highlightValue(nil, callDelegate: false)

Divya Saraswati
- 159
- 9