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

BarLineChartViewBase doubleTapGestureRecognized #3417

Closed
757388559 opened this issue Apr 25, 2018 · 1 comment
Closed

BarLineChartViewBase doubleTapGestureRecognized #3417

757388559 opened this issue Apr 25, 2018 · 1 comment

Comments

@757388559
Copy link

757388559 commented Apr 25, 2018

This is source code for charts:
@objc private func doubleTapGestureRecognized(_ recognizer: NSUITapGestureRecognizer)
{
if _data === nil
{
return
}

    if recognizer.state == NSUIGestureRecognizerState.ended
    {
        if _data !== nil && _doubleTapToZoomEnabled && (data?.entryCount ?? 0) > 0
        {
            var location = recognizer.location(in: self)
            location.x = location.x - _viewPortHandler.offsetLeft
            
            if isTouchInverted()
            {
                location.y = -(location.y - _viewPortHandler.offsetTop)
            }
            else
            {
                location.y = -(self.bounds.size.height - location.y - _viewPortHandler.offsetBottom)
            }
            
            self.zoom(scaleX: isScaleXEnabled ? 1.4 : 1.0, scaleY: isScaleYEnabled ? 1.4 : 1.0, x: location.x, y: location.y)
        }
    }
}

we can know the scale factor is fixed, we can't set it,And the doubleTapGestureRecognized don't
use scale delegate。
The question:
1.How to set the scale factor?
2.hope the scale delegate is used

@liuxuan30
Copy link
Member

it's in ChartTransformer and ViewPortHanlder.

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