Charts: Pinch to Zoom is not working as expected over Bar Chart

Created on 26 May 2017  ·  2Comments  ·  Source: danielgindi/Charts

Hi,

I have used bar chart. And currently set the following properties of it:

self.barChart?.doubleTapToZoomEnabled = false
self.barChart?.pinchZoomEnabled = false
barChart.dragEnabled = false

But still the zoom is happening. One of the reason that I have not tried out might be disable the individual axis scaling. Can some one please provide me the code for that or any other solution that will work ?

Most helpful comment

you may forgot to use this:

Objective-c:

    self.chartView.scaleXEnabled = NO;
    self.chartView.scaleYEnabled = NO;

swift:

    self.barChart?.scaleYEnabled = false
    self.barChart?.scaleXEnabled = false

All 2 comments

Are you saying if you turn off pinchZoomEnabled, pinch zoom still work? I suspect it. Please just search the code how it's enforced and see what you have to disable.

e.g.

            if _data !== nil &&
                (_pinchZoomEnabled || _scaleXEnabled || _scaleYEnabled)
            {

it's OR op, so only disable one is not enough.

you may forgot to use this:

Objective-c:

    self.chartView.scaleXEnabled = NO;
    self.chartView.scaleYEnabled = NO;

swift:

    self.barChart?.scaleYEnabled = false
    self.barChart?.scaleXEnabled = false
Was this page helpful?
0 / 5 - 0 ratings

Related issues

brytnvmg picture brytnvmg  ·  4Comments

newbiebie picture newbiebie  ·  3Comments

PrashantKT picture PrashantKT  ·  3Comments

guoyutaog picture guoyutaog  ·  3Comments

BrandonShega picture BrandonShega  ·  4Comments