Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoScaleMinMaxEnabled Not Working #2374

Closed
jjstyle0427 opened this issue Apr 19, 2017 · 1 comment
Closed

autoScaleMinMaxEnabled Not Working #2374

jjstyle0427 opened this issue Apr 19, 2017 · 1 comment

Comments

@jjstyle0427
Copy link

When I set
lineChartView.rightAxis.enabled = false and
lineChartView.leftAxis.enabled = false at the same time

then autoScaleMinMaxEnabled = true is not working

I don't know what's happend

@liuxuan30
Copy link
Member

    /// Performs auto scaling of the axis by recalculating the minimum and maximum y-values based on the entries currently in view.
    internal func autoScale()
    {
        guard let data = _data
            else { return }
        
        data.calcMinMaxY(fromX: self.lowestVisibleX, toX: self.highestVisibleX)
        
        _xAxis.calculate(min: data.xMin, max: data.xMax)
        
        // calculate axis range (min / max) according to provided data
        
        if _leftAxis.isEnabled
        {
            _leftAxis.calculate(min: data.getYMin(axis: .left), max: data.getYMax(axis: .left))
        }
        
        if _rightAxis.isEnabled
        {
            _rightAxis.calculate(min: data.getYMin(axis: .right), max: data.getYMax(axis: .right))
        }
        
        calculateOffsets()
    }

you disabled them that's why they don't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants