Ok. I managed to get the animation to work to an extent that I feel is
sufficient for my application.
Instead of using CATransform3DMakeScale, I set the fromValue and
toValue to 0.0 and 1.0 respectively.
This animated the bar plot to scale from the center, so i moved the
anchor point of bar plot to 0,0 and the bar now animates vertically
here is the code:
barPlot.anchorPoint = CGPointMake(0.0, 0.0); // Moved anchor point,
initially it was set to center 0.5
CABasicAnimation *scaling = [CABasicAnimation
animationWithKeyPath:@"transform.scale.y"]; // scaling only on the y
axis
scaling.fromValue = [NSNumber numberWithFloat:0.0];
scaling.toValue = [NSNumber numberWithFloat:1.0];
scaling.duration = 3.0f; // Duration
scaling.removedOnCompletion = NO;
scaling.fillMode = kCAFillModeForwards;
[barPlot addAnimation:scaling forKey:@"scaling"];