Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the cross and other touch events in ios-charts?

Tags:

ios

ios-charts

i have a Line Chart view in my iOS app.

@IBOutlet weak var lineChartView: LineChartView!

the zooming and touching is enabled. I do not let the user do anything in the chart, even selecting is not allowed.

I tried:

self.lineChartView.pinchZoomEnabled = false
self.lineChartView.dragEnabled = false
self.lineChartView.dragDecelerationEnabled = false

but without any luck. I can still touch the graph and see the cross. I even can pinch to zoom the graph.

How can i turn this behaviour off?+

like image 901
Peter Shaw Avatar asked Jan 16 '17 17:01

Peter Shaw


1 Answers

In case anyone would like it to still drag but only disable zooming, you can try self.lineChart.setScaleEnabled(false)

like image 176
Kelvin Tan Avatar answered Jan 09 '23 01:01

Kelvin Tan