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

How to make CandleStickChart and BarChart do the same action #685

Closed
z404558 opened this issue Jan 20, 2016 · 1 comment
Closed

How to make CandleStickChart and BarChart do the same action #685

z404558 opened this issue Jan 20, 2016 · 1 comment

Comments

@z404558
Copy link

z404558 commented Jan 20, 2016

I have a CandleStickChart and a BarChart below it. When I make CandleStickChart zoom in or out or translate, I want BarChart do the same action.
Do you have a solution about this?

  • (void)chartScaled:(ChartViewBase * __nonnull)chartView scaleX:(CGFloat)scaleX scaleY:(CGFloat)scaleY
    {

    NSLog(@"1:scaleX:%f_____scaleY:%f",scaleX,scaleY);

    if (chartView.tag == 100) {

    [_dayK_squareView setVisibleXRangeMinimum:5];
    
    
    [_dayK_squareView zoom:scaleX scaleY:scaleY x:0 y:0];
    

    }

    if (chartView.tag == 200) {
    [_day_Candle_chartView setVisibleXRangeMinimum:5];

    [_day_Candle_chartView zoom:scaleX scaleY:scaleY x:0 y:0];
    

    }
    }

@liuxuan30
Copy link
Member

You can achieve this by using

public func refresh(newMatrix newMatrix: CGAffineTransform, chart: ChartViewBase, invalidate: Bool) -> CGAffineTransform
public func zoom(scaleX scaleX: CGFloat, scaleY: CGFloat, x: CGFloat, y: CGFloat) -> CGAffineTransform

zoom is used to get the target matrix, and later used in refresh
and other functions in ChartViewPortHandler

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