Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2046131143 | |||
| 208a727d88 |
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.5.2">2.5.2</a>
|
||||
#### 05/06/14
|
||||
- Fixed compiler warnings.
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.5.1">2.5.1</a>
|
||||
#### 05/05/14
|
||||
- Additional fixes to issue <a href="https://github.com/Jawbone/JBChartView/pull/48">#48</a>.
|
||||
|
||||
+15
-11
@@ -410,7 +410,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
CGFloat maxLineWidth = 0.0f;
|
||||
NSAssert([self.dataSource respondsToSelector:@selector(numberOfLinesInLineChartView:)], @"JBLineChartView // dataSource must implement - (NSUInteger)numberOfLinesInLineChartView:(JBLineChartView *)lineChartView");
|
||||
|
||||
for (int lineIndex=0; lineIndex<[self.dataSource numberOfLinesInLineChartView:self]; lineIndex++)
|
||||
for (NSUInteger lineIndex=0; lineIndex<[self.dataSource numberOfLinesInLineChartView:self]; lineIndex++)
|
||||
{
|
||||
BOOL showsDots = NO;
|
||||
if ([self.dataSource respondsToSelector:@selector(lineChartView:showsDotsForLineAtLineIndex:)])
|
||||
@@ -622,7 +622,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
} completion:^(BOOL finished) {
|
||||
[UIView animateWithDuration:kJBLineChartViewStateAnimationDuration delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
|
||||
adjustViewFrames();
|
||||
} completion:^(BOOL finished) {
|
||||
} completion:^(BOOL adjustFinished) {
|
||||
if (callback)
|
||||
{
|
||||
callback();
|
||||
@@ -778,8 +778,8 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
- (NSInteger)lineIndexForPoint:(CGPoint)point
|
||||
{
|
||||
// Find the horizontal indexes
|
||||
NSInteger leftHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampLeft];
|
||||
NSInteger rightHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampRight];
|
||||
NSUInteger leftHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampLeft];
|
||||
NSUInteger rightHorizontalIndex = [self horizontalIndexForPoint:point indexClamp:JBLineChartHorizontalIndexClampRight];
|
||||
|
||||
// Padding
|
||||
CGFloat chartPadding = [self padding];
|
||||
@@ -1140,12 +1140,14 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
{
|
||||
_selectedLineIndex = selectedLineIndex;
|
||||
|
||||
__weak JBLineChartLinesView* weakSelf = self;
|
||||
|
||||
dispatch_block_t adjustLines = ^{
|
||||
for (CALayer *layer in [self.layer sublayers])
|
||||
for (CALayer *layer in [weakSelf.layer sublayers])
|
||||
{
|
||||
if ([layer isKindOfClass:[JBLineLayer class]])
|
||||
{
|
||||
if (((JBLineLayer *)layer).tag == _selectedLineIndex)
|
||||
if (((NSInteger)((JBLineLayer *)layer).tag) == weakSelf.selectedLineIndex)
|
||||
{
|
||||
NSAssert([self.delegate respondsToSelector:@selector(lineChartLinesView:selectedColorForLineAtLineIndex:)], @"JBLineChartLinesView // delegate must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView selectedColorForLineAtLineIndex:(NSUInteger)lineIndex");
|
||||
((JBLineLayer *)layer).strokeColor = [self.delegate lineChartLinesView:self selectedColorForLineAtLineIndex:((JBLineLayer *)layer).tag].CGColor;
|
||||
@@ -1155,7 +1157,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
{
|
||||
NSAssert([self.delegate respondsToSelector:@selector(lineChartLinesView:colorForLineAtLineIndex:)], @"JBLineChartLinesView // delegate must implement - (UIColor *)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView colorForLineAtLineIndex:(NSUInteger)lineIndex");
|
||||
((JBLineLayer *)layer).strokeColor = [self.delegate lineChartLinesView:self colorForLineAtLineIndex:((JBLineLayer *)layer).tag].CGColor;
|
||||
((JBLineLayer *)layer).opacity = (_selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : kJBLineChartLinesViewDefaultDimmedOpacity;
|
||||
((JBLineLayer *)layer).opacity = (weakSelf.selectedLineIndex == kJBLineChartLinesViewUnselectedLineIndex) ? 1.0f : kJBLineChartLinesViewDefaultDimmedOpacity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1278,16 +1280,18 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
{
|
||||
_selectedLineIndex = selectedLineIndex;
|
||||
|
||||
__weak JBLineChartDotsView* weakSelf = self;
|
||||
|
||||
dispatch_block_t adjustDots = ^{
|
||||
[self.dotViewsDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
|
||||
[weakSelf.dotViewsDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
|
||||
NSUInteger horizontalIndex = 0;
|
||||
for (JBLineChartDotView *dotView in (NSArray *)obj)
|
||||
{
|
||||
if ([key isKindOfClass:[NSNumber class]])
|
||||
{
|
||||
NSUInteger lineIndex = [((NSNumber *)key) intValue];
|
||||
NSInteger lineIndex = [((NSNumber *)key) intValue];
|
||||
|
||||
if (_selectedLineIndex == lineIndex)
|
||||
if (weakSelf.selectedLineIndex == lineIndex)
|
||||
{
|
||||
NSAssert([self.delegate respondsToSelector:@selector(lineChartDotsView:selectedColorForDotAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // delegate must implement - (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView selectedColorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
|
||||
dotView.backgroundColor = [self.delegate lineChartDotsView:self selectedColorForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
|
||||
@@ -1296,7 +1300,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
{
|
||||
NSAssert([self.delegate respondsToSelector:@selector(lineChartDotsView:colorForDotAtHorizontalIndex:atLineIndex:)], @"JBLineChartDotsView // delegate must implement - (UIColor *)lineChartDotsView:(JBLineChartDotsView *)lineChartDotsView colorForDotAtHorizontalIndex:(NSUInteger)horizontalIndex atLineIndex:(NSUInteger)lineIndex");
|
||||
dotView.backgroundColor = [self.delegate lineChartDotsView:self colorForDotAtHorizontalIndex:horizontalIndex atLineIndex:lineIndex];
|
||||
dotView.alpha = (_selectedLineIndex == kJBLineChartDotsViewUnselectedLineIndex) ? 1.0f : 0.0f; // hide dots on off-selection
|
||||
dotView.alpha = (weakSelf.selectedLineIndex == kJBLineChartDotsViewUnselectedLineIndex) ? 1.0f : 0.0f; // hide dots on off-selection
|
||||
}
|
||||
}
|
||||
horizontalIndex++;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "JBChartView"
|
||||
s.version = "2.5.1"
|
||||
s.version = "2.5.2"
|
||||
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.5.1"
|
||||
:tag => "v2.5.2"
|
||||
}
|
||||
|
||||
s.platform = :ios, '7.0'
|
||||
|
||||
Reference in New Issue
Block a user