Compare commits

..

3 Commits

Author SHA1 Message Date
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
5 changed files with 72 additions and 60 deletions
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## <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>.
+11
View File
@@ -162,6 +162,17 @@ static UIColor *kJBChartVerticalSelectionViewDefaultBgColor = nil;
_hasMaximumValue = NO; // clears max
}
- (void)setFrame:(CGRect)frame
{
[super setFrame:frame];
// because frame is set early, we may not have sources
if (self.delegate != nil && self.dataSource != nil)
{
[self reloadData]; // reload all subviews on frame change
}
}
@end
@implementation JBChartVerticalSelectionView
+54 -57
View File
@@ -267,13 +267,13 @@ 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];
for (NSInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
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");
NSUInteger dataCount = [self.dataSource lineChartView:self numberOfVerticalValuesAtLineIndex:lineIndex];
NSMutableArray *chartPointData = [NSMutableArray array];
for (NSInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
for (NSUInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
{
NSAssert([self.delegate respondsToSelector:@selector(lineChartView:verticalValueForHorizontalIndex:atLineIndex:)], @"JBLineChartView // delegate must implement - (CGFloat)lineChartView:(JBLineChartView *)lineChartView verticalValueForHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
CGFloat rawHeight = [self.delegate lineChartView:self verticalValueForHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
@@ -457,71 +457,68 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
CGFloat maxDotLength = 0;
if (showsDots)
{
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 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 (NSInteger 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;
}
}
}
@@ -776,12 +773,12 @@ 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];
for (NSInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
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");
NSUInteger dataCount = [self.dataSource lineChartView:self numberOfVerticalValuesAtLineIndex:lineIndex];
for (NSInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
for (NSUInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
{
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];
@@ -803,12 +800,12 @@ 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];
for (NSInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
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");
NSUInteger dataCount = [self.dataSource lineChartView:self numberOfVerticalValuesAtLineIndex:lineIndex];
for (NSInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
for (NSUInteger horizontalIndex=0; horizontalIndex<dataCount; horizontalIndex++)
{
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];
@@ -900,10 +897,10 @@ 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 (NSInteger lineIndex=0; lineIndex<numberOfLines; lineIndex++)
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");
if ([self.dataSource lineChartView:self numberOfVerticalValuesAtLineIndex:lineIndex] > rightHorizontalIndex)
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "JBChartView"
s.version = "2.8.8"
s.version = "2.8.9"
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.8"
:tag => "v2.8.9"
}
s.platform = :ios, '6.0'
+1 -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.8'
pod 'JBChartView', '~> 2.8.9'
### The Old School Way