Compare commits

...

8 Commits

Author SHA1 Message Date
Terry Worona 64451dd5ac pod spec and read me updates 2014-09-22 19:05:18 -07:00
Terry Worona 36d72ce510 change log and comments 2014-09-22 19:03:25 -07:00
Terry Worona efd8f97335 Removed changes for setFrame 2014-09-22 19:00:10 -07:00
Terry Worona 243c28cffb update to change log, read me, pod spec, etc 2014-09-22 11:18:11 -07:00
Terry Worona 66bf3b14e8 Fixed #111 2014-09-22 11:16:48 -07:00
Terry Worona 7287712da3 More cleanup of compiler warnings on iOS 8 2014-09-22 11:11:32 -07:00
Terry Worona e71db56a76 updated read me, change log, etc 2014-09-19 19:41:52 -07:00
Terry Worona 4be903eda7 fixed some compiler warnings 2014-09-19 19:35:37 -07:00
6 changed files with 69 additions and 56 deletions
+12
View File
@@ -1,5 +1,17 @@
# Changelog
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.8.10">2.8.10</a>
#### 09/22/14
- Reverted fix for issue <a href="https://github.com/Jawbone/JBChartView/issues/111">#111</a>.
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.8.9">2.8.9</a>
#### 09/22/14
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/issues/111">#111</a>.
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.8.8">2.8.8</a>
#### 09/19/14
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/issues/110">#110</a>.
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.8.7">2.8.7</a>
#### 09/08/14
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/issues/107">#107</a>.
+1 -1
View File
@@ -400,7 +400,7 @@ static UIColor *kJBBarChartViewDefaultBarColor = nil;
[UIView animateWithDuration:kJBBarChartViewStateAnimationDuration delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
updateBarView(barView, NO);
} completion:^(BOOL lastBarFinished) {
if (barView.tag == [self.barViews count] - 1)
if ((NSUInteger)barView.tag == [self.barViews count] - 1)
{
if (callbackCopy)
{
+1
View File
@@ -120,6 +120,7 @@ typedef NS_ENUM(NSInteger, JBChartViewState){
/**
* Acts similiar to a UITableView's reloadData function.
* The entire chart will be torn down and re-constructed via datasource and delegate protocls.
* If a chart's frame changes, reloadData must be called directly afterwards for the changes to take effect.
*/
- (void)reloadData;
+49 -52
View File
@@ -267,7 +267,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
NSMutableArray *mutableChartData = [NSMutableArray array];
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
NSInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
NSUInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
for (NSUInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartView:numberOfVerticalValuesAtLineIndex:)], @"JBLineChartView // dataSource must implement - (NSUInteger)lineChartView:(JBLineChartView *)lineChartView numberOfVerticalValuesAtLineIndex:(NSUInteger)lineIndex");
@@ -440,7 +440,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
NSInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
for (NSUInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
for (NSInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
{
BOOL showsDots = NO;
if ([self.dataSource respondsToSelector:@selector(lineChartView:showsDotsForLineAtLineIndex:)])
@@ -457,71 +457,68 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
CGFloat maxDotLength = 0;
if (showsDots)
{
for (NSUInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
NSAssert([self.dataSource respondsToSelector:@selector(lineChartView:numberOfVerticalValuesAtLineIndex:)], @"JBLineChartView // dataSource must implement - (NSUInteger)lineChartView:(JBLineChartView *)lineChartView numberOfVerticalValuesAtLineIndex:(NSUInteger)lineIndex");
NSUInteger dataCount = [self.dataSource lineChartView:self numberOfVerticalValuesAtLineIndex:lineIndex];
for (NSUInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartView:numberOfVerticalValuesAtLineIndex:)], @"JBLineChartView // dataSource must implement - (NSUInteger)lineChartView:(JBLineChartView *)lineChartView numberOfVerticalValuesAtLineIndex:(NSUInteger)lineIndex");
NSUInteger dataCount = [self.dataSource lineChartView:self numberOfVerticalValuesAtLineIndex:lineIndex];
BOOL shouldEvaluateDotSize = NO;
for (NSUInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
// Left dot
if (horizontalIndex == 0)
{
BOOL shouldEvaluateDotSize = NO;
shouldEvaluateDotSize = YES;
}
// Right dot
else if (horizontalIndex == (dataCount - 1))
{
shouldEvaluateDotSize = YES;
}
else
{
NSAssert([self.delegate respondsToSelector:@selector(lineChartView:verticalValueForHorizontalIndex:atLineIndex:)], @"JBLineChartView // delegate must implement - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
CGFloat height = [self.delegate lineChartView:self verticalValueForHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
// Left dot
if (horizontalIndex == 0)
// Top
if (height == [self cachedMaxHeight])
{
shouldEvaluateDotSize = YES;
}
// Right dot
else if (horizontalIndex == (dataCount - 1))
// Bottom
else if (height == [self cachedMinHeight])
{
shouldEvaluateDotSize = YES;
}
else
{
NSAssert([self.delegate respondsToSelector:@selector(lineChartView:verticalValueForHorizontalIndex:atLineIndex:)], @"JBLineChartView // delegate must implement - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
CGFloat height = [self.delegate lineChartView:self verticalValueForHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
// Top
if (height == [self cachedMaxHeight])
{
shouldEvaluateDotSize = YES;
}
// Bottom
else if (height == [self cachedMinHeight])
{
shouldEvaluateDotSize = YES;
}
}
if (shouldEvaluateDotSize)
}
if (shouldEvaluateDotSize)
{
if ([self.dataSource respondsToSelector:@selector(lineChartView:dotViewAtHorizontalIndex:atLineIndex:)])
{
if ([self.dataSource respondsToSelector:@selector(lineChartView:dotViewAtHorizontalIndex:atLineIndex:)])
{
if ([self.dataSource respondsToSelector:@selector(lineChartView:dotViewAtHorizontalIndex:atLineIndex:)])
UIView *customDotView = [self.dataSource lineChartView:self dotViewAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
if (customDotView.frame.size.width > maxDotLength || customDotView.frame.size.height > maxDotLength)
{
UIView *customDotView = [self.dataSource lineChartView:self dotViewAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
if (customDotView.frame.size.width > maxDotLength || customDotView.frame.size.height > maxDotLength)
{
maxDotLength = fmaxf(customDotView.frame.size.width, customDotView.frame.size.height);
}
maxDotLength = fmaxf(customDotView.frame.size.width, customDotView.frame.size.height);
}
}
else if ([self.delegate respondsToSelector:@selector(lineChartView:dotRadiusForDotAtHorizontalIndex:atLineIndex:)])
}
else if ([self.delegate respondsToSelector:@selector(lineChartView:dotRadiusForDotAtHorizontalIndex:atLineIndex:)])
{
CGFloat dotRadius = [self.delegate lineChartView:self dotRadiusForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
if (dotRadius > maxDotLength)
{
CGFloat dotRadius = [self.delegate lineChartView:self dotRadiusForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
if (dotRadius > maxDotLength)
{
maxDotLength = dotRadius;
}
maxDotLength = dotRadius;
}
else
}
else
{
CGFloat defaultDotRadius = lineWidth * kJBLineChartDotsViewDefaultRadiusFactor;
if (defaultDotRadius > maxDotLength)
{
CGFloat defaultDotRadius = lineWidth * kJBLineChartDotsViewDefaultRadiusFactor;
if (defaultDotRadius > maxDotLength)
{
maxDotLength = defaultDotRadius;
}
maxDotLength = defaultDotRadius;
}
}
}
@@ -542,7 +539,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
NSUInteger dataCount = 0;
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
NSInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
for (NSUInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
for (NSInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartView:numberOfVerticalValuesAtLineIndex:)], @"JBLineChartView // dataSource must implement - (NSUInteger)lineChartView:(JBLineChartView *)lineChartView numberOfVerticalValuesAtLineIndex:(NSUInteger)lineIndex");
NSUInteger lineDataCount = [self.dataSource lineChartView:self numberOfVerticalValuesAtLineIndex:lineIndex];
@@ -776,7 +773,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
{
CGFloat minHeight = FLT_MAX;
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
NSInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
NSUInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
for (NSUInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartView:numberOfVerticalValuesAtLineIndex:)], @"JBLineChartView // dataSource must implement - (NSUInteger)lineChartView:(JBLineChartView *)lineChartView numberOfVerticalValuesAtLineIndex:(NSUInteger)lineIndex");
@@ -803,7 +800,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
{
CGFloat maxHeight = 0;
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
NSInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
NSUInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
for (NSUInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
{
NSAssert([self.dataSource respondsToSelector:@selector(lineChartView:numberOfVerticalValuesAtLineIndex:)], @"JBLineChartView // dataSource must implement - (NSUInteger)lineChartView:(JBLineChartView *)lineChartView numberOfVerticalValuesAtLineIndex:(NSUInteger)lineIndex");
@@ -900,7 +897,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
NSUInteger shortestDistance = INT_MAX;
NSInteger selectedIndex = kJBLineChartUnselectedLineIndex;
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
NSInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
NSUInteger numberOfLines = [self.dataSource numberOfLinesInLineChartView:self];
// Iterate all lines
for (NSUInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "JBChartView"
s.version = "2.8.7"
s.version = "2.8.10"
s.summary = "Jawbone's iOS-based charting library for both line and bar graphs."
s.homepage = "https://github.com/Jawbone/JBChartView"
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.author = { "Terry Worona" => "tworona@jawbone.com" }
s.source = {
:git => "https://github.com/Jawbone/JBChartView.git",
:tag => "v2.8.7"
:tag => "v2.8.10"
}
s.platform = :ios, '6.0'
+4 -1
View File
@@ -43,7 +43,7 @@ Simply add the following line to your <code>Podfile</code>:
Your Podfile should look something like:
platform :ios, '6.0'
pod 'JBChartView', '~> 2.8.7'
pod 'JBChartView', '~> 2.8.9'
### The Old School Way
@@ -95,6 +95,8 @@ Lastly, ensure you have set the *frame* of your barChartView & call *reloadData*
barChartView.frame = CGRectMake( ... );
[barChartView reloadData];
**Note**: subsequent changes to the chart's frame will not invoke *reloadData*; it must be called directly afterwards for any changes to take effect.
#### JBLineChartView
@@ -129,6 +131,7 @@ Lastly, ensure you have set the *frame* of your lineChartView & call *reloadData
lineChartView.frame = CGRectMake( ... );
[lineChartView reloadData];
**Note**: subsequent changes to the chart's frame will not invoke *reloadData*; it must be called directly afterwards for any changes to take effect.
## Customization