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

Bars with Animation from bottom to Top #6

Open
networkharry04 opened this issue Jan 7, 2014 · 3 comments
Open

Bars with Animation from bottom to Top #6

networkharry04 opened this issue Jan 7, 2014 · 3 comments

Comments

@networkharry04
Copy link

Hello ,

I am using your open source Awesome library which meet my all requirements to plot bar graphs.

I want bar animation from bottom to top. When you are releasing library with this feature. Please let me know how can i create bar animations .

Regards
Harpreet

@Sam-Spencer
Copy link

@networkharry04 Take a look at my fork of this repo. It is much more active, has newer and better features, and is well maintained. In addition to that, there are numerous improvements to chart animations on my fork. In the newest version on my fork, you can choose between three different types of animations (in addition to no animation). If you have any questions or issues with my fork, please open an issue on the fork (not the main repo) - then I can explain more and provide more details.

@networkharry04
Copy link
Author

Thank you so much for update. Its really helpful and amazing.

@bablu-joshi
Copy link

  • (void)layoutSubviews {
    [super layoutSubviews];

    [self calculateFrames];
    NSUInteger index = 0;
    for (NSDictionary barInfo in chartDataArray) {
    BarView *bar = [barViews objectAtIndex:index];
    bar.frame = CGRectMake((barFullWidth - barWidth)/2 + index
    (barFullWidth),
    plotView.height - roundf([[barInfo objectForKey:@"value"] floatValue]_barHeightRatio),
    barWidth, roundf([[barInfo objectForKey:@"value"] floatValue]_barHeightRatio));
    [bar setNeedsDisplay];

    NSLog(@"%f",bar.height);
    if (showAxisX) {
        BarLabel *barLabel = [barLabels objectAtIndex:index];
        barLabel.frame = CGRectMake(roundf(plotView.left + index*barFullWidth),
                                    plotChart.bottom - PLOT_PADDING_BOTTOM,
                                    barFullWidth, fontSize + PLOT_PADDING_BOTTOM);
    
        [barLabel setNeedsDisplay];
    }
    index++;
    if (!isInitialAnimation) {
        [self animateBars];
        isInitialAnimation=!isInitialAnimation;
    }
    

    }
    }

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

3 participants