Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8dbb2679ee | |||
| 867466d1d1 | |||
| 2046131143 | |||
| 208a727d88 | |||
| 43c6e9486f | |||
| 49206a01ed |
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.5.3">2.5.3</a>
|
||||
#### 05/06/14
|
||||
- More compiler warning fixes.
|
||||
|
||||
## <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>.
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.5.0">2.5.0</a>
|
||||
#### 05/04/14
|
||||
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/pull/48">#48</a>.
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef NS_ENUM(NSInteger, JBChartViewState){
|
||||
* The minimum and maxmimum values of the chart.
|
||||
* If no value(s) are supplied:
|
||||
*
|
||||
* minimumValue = 0
|
||||
* minimumValue = chart's data source min value.
|
||||
* maxmimumValue = chart's data source max value.
|
||||
*
|
||||
* If value(s) are supplied, they must be >= 0, otherwise an assertion will be thrown.
|
||||
@@ -55,8 +55,9 @@ typedef NS_ENUM(NSInteger, JBChartViewState){
|
||||
@property (nonatomic, assign) CGFloat minimumValue;
|
||||
@property (nonatomic, assign) CGFloat maximumValue;
|
||||
|
||||
- (void)resetMinimumValue; // resets to default (0)
|
||||
- (void)resetMaximumValue; // reset to default (chart's data source max value)
|
||||
// reset to default (chart's data source min & max value)
|
||||
- (void)resetMinimumValue;
|
||||
- (void)resetMaximumValue;
|
||||
|
||||
/**
|
||||
* Charts can either be expanded or contracted.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
// Numerics
|
||||
CGFloat const kJBChartViewDefaultAnimationDuration = 0.25f;
|
||||
CGFloat const kJBChartViewDefaulMinimumValue = 0.0f;
|
||||
|
||||
// Color (JBChartSelectionView)
|
||||
static UIColor *kJBChartVerticalSelectionViewDefaultBgColor = nil;
|
||||
@@ -62,7 +61,6 @@ static UIColor *kJBChartVerticalSelectionViewDefaultBgColor = nil;
|
||||
- (void)constructChartView
|
||||
{
|
||||
self.clipsToBounds = YES;
|
||||
self.minimumValue = kJBChartViewDefaulMinimumValue;
|
||||
}
|
||||
|
||||
#pragma mark - Public
|
||||
@@ -156,7 +154,7 @@ static UIColor *kJBChartVerticalSelectionViewDefaultBgColor = nil;
|
||||
|
||||
- (void)resetMinimumValue
|
||||
{
|
||||
self.minimumValue = kJBChartViewDefaulMinimumValue; // resets to default
|
||||
_hasMinimumValue = NO; // clears min
|
||||
}
|
||||
|
||||
- (void)resetMaximumValue
|
||||
|
||||
+16
-12
@@ -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];
|
||||
@@ -1041,7 +1041,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
path.miterLimit = kJBLineChartLinesViewMiterLimit;
|
||||
|
||||
JBLineChartPoint *previousLineChartPoint = nil;
|
||||
CGFloat previousSlope;
|
||||
CGFloat previousSlope = 0.0f;
|
||||
|
||||
NSAssert([self.delegate respondsToSelector:@selector(lineChartLinesView:smoothLineAtLineIndex:)], @"JBLineChartLinesView // delegate must implement - (BOOL)lineChartLinesView:(JBLineChartLinesView *)lineChartLinesView smoothLineAtLineIndex:(NSUInteger)lineIndex");
|
||||
BOOL smoothLine = [self.delegate lineChartLinesView:self smoothLineAtLineIndex:lineIndex];
|
||||
@@ -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.0"
|
||||
s.version = "2.5.3"
|
||||
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.0"
|
||||
:tag => "v2.5.3"
|
||||
}
|
||||
|
||||
s.platform = :ios, '7.0'
|
||||
|
||||
@@ -38,7 +38,7 @@ Simply add the following line to your <code>Podfile</code>:
|
||||
Your Podfile should look something like:
|
||||
|
||||
platform :ios, '7.0'
|
||||
pod 'JBChartView', '~> 2.5.0'
|
||||
pod 'JBChartView', '~> 2.5.3'
|
||||
|
||||
### The Old School Way
|
||||
|
||||
@@ -232,7 +232,7 @@ The <b>touchPoint</b> is especially important as it allows you to add custom ele
|
||||
|
||||
## Minimum & Maximum Values
|
||||
|
||||
By default, a chart's minimum value (y-axis) is equal to 0. The maximum is equal to the max value supplied by the dataSource. You can override either value via:
|
||||
By default, a chart's minimum and maximum values are equal to the min and max supplied by the dataSource. You can override either value via:
|
||||
|
||||
- (void)setMinimumValue:(CGFloat)minimumValue;
|
||||
- (void)setMaximumValue:(CGFloat)maximumValue;
|
||||
|
||||
Reference in New Issue
Block a user