Compare commits

..

8 Commits

Author SHA1 Message Date
Terry Worona 409b58c53c updated pod spec and read me 2013-12-23 18:02:30 -05:00
Terry Worona 0b6108dea8 resolved #4 | removed bar shadow from bar chart subviews 2013-12-23 17:50:20 -05:00
Terry Worona c7fe1c4114 updated specs and readme 2013-12-17 11:37:47 -08:00
Terry Worona 318d59dadd Fixed footer touches up alpha bug 2013-12-17 11:35:45 -08:00
Terry Worona ffd12921a4 updated read me and podspec 2013-12-14 23:26:16 -08:00
Terry Worona ef2f02743f Added footer view checks for selection views 2013-12-14 23:24:28 -08:00
terryworona 74d63d31e3 Merge pull request #2 from joelkraut/master
If there is no footer view, bars won't be added to the chart.
2013-12-14 23:18:42 -08:00
Joel Kraut 49c7bdee0c If there is no footer view, bars won't be added to the chart. 2013-12-13 15:43:58 -08:00
4 changed files with 34 additions and 22 deletions
+24 -9
View File
@@ -139,15 +139,19 @@ static UIColor *kJBBarChartViewDefaultBarColor = nil;
barView.backgroundColor = kJBBarChartViewDefaultBarColor;
}
CGFloat height = [self normalizedHeightForRawHeight:[self.chartDataDictionary objectForKey:key]];
barView.frame = CGRectMake(xOffset, self.bounds.size.height - height - self.footerView.frame.size.height + self.headerPadding, [self barWidth], height + kJBBarChartViewPopOffset - self.headerPadding);
barView.layer.shadowColor = [UIColor blackColor].CGColor;
barView.layer.shadowOffset = CGSizeMake(0, 0);
barView.layer.shadowOpacity = 0.4;
barView.layer.shadowRadius = 1.0;
barView.frame = CGRectMake(xOffset, self.bounds.size.height - height - self.footerView.frame.size.height + self.headerPadding, [self barWidth], height + kJBBarChartViewPopOffset - self.headerPadding);
[mutableBarViews addObject:barView];
[self insertSubview:barView belowSubview:self.footerView];
// Add new bar
if (self.footerView)
{
[self insertSubview:barView belowSubview:self.footerView];
}
else
{
[self addSubview:barView];
}
xOffset += ([self barWidth] + self.barPadding);
index++;
}
@@ -158,6 +162,8 @@ static UIColor *kJBBarChartViewDefaultBarColor = nil;
* Creates a vertical selection view for touch events
*/
dispatch_block_t createSelectionView = ^{
// Remove old selection bar
if (self.selectionView)
{
[self.selectionView removeFromSuperview];
@@ -170,7 +176,16 @@ static UIColor *kJBBarChartViewDefaultBarColor = nil;
{
self.selectionView.bgColor = [self.dataSource selectionBarColorForBarChartView:self];
}
[self insertSubview:self.selectionView belowSubview:self.footerView];
// Add new selection bar
if (self.footerView)
{
[self insertSubview:self.selectionView belowSubview:self.footerView];
}
else
{
[self addSubview:self.selectionView];
}
};
createDataDictionaries();
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "JBChartView"
s.version = "1.0"
s.version = "1.0.3"
s.summary = "Jawbone's iOS-based charting library for both line and bar graphs."
s.homepage = "https://github.com/Jawbone/JBChartView"
@@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.author = { "Terry Worona" => "tworona@jawbone.com" }
s.source = {
:git => "https://github.com/Jawbone/JBChartView.git",
:tag => "v1.0"
:tag => "v1.0.3"
}
s.platform = :ios, '7.0'
@@ -185,7 +185,7 @@ static UIColor *kJBChartInformationViewShadowColor = nil;
{
if (hidden)
{
[UIView animateWithDuration:kJBNumericDefaultAnimationDuration * 0.5 animations:^{
[UIView animateWithDuration:kJBNumericDefaultAnimationDuration * 0.5 delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
self.titleLabel.alpha = 0.0;
self.separatorView.alpha = 0.0;
self.valueView.valueLabel.alpha = 0.0;
@@ -197,17 +197,14 @@ static UIColor *kJBChartInformationViewShadowColor = nil;
}
else
{
[UIView animateWithDuration:kJBNumericDefaultAnimationDuration animations:^{
[UIView animateWithDuration:kJBNumericDefaultAnimationDuration delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
self.titleLabel.frame = [self titleViewRectForHidden:NO];
self.titleLabel.alpha = hidden ? 0.0 : 1.0;
self.titleLabel.alpha = 1.0;
self.valueView.valueLabel.alpha = 1.0;
self.valueView.unitLabel.alpha = 1.0;
self.separatorView.frame = [self separatorViewRectForHidden:NO];
self.separatorView.alpha = hidden ? 0.0 : 1.0;
} completion:^(BOOL finished) {
[UIView animateWithDuration:kJBNumericDefaultAnimationDuration animations:^{
self.valueView.valueLabel.alpha = hidden ? 0.0 : 1.0;
self.valueView.unitLabel.alpha = hidden ? 0.0 : 1.0;
}];
}];
self.separatorView.alpha = 1.0;
} completion:nil];
}
}
else
+1 -1
View File
@@ -36,7 +36,7 @@ Simply add the following line to your <code>Podfile</code>:
Your Podfile should look something like:
platform :ios, '7.0'
pod 'JBChartView', '~> 1.0'
pod 'JBChartView', '~> 1.0.3'
### The Old School Way