Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3cc39124b8 | |||
| bedd7e2c71 | |||
| 786af91666 | |||
| b7927cddb7 | |||
| 0f2d4d766c | |||
| 64de3e6e23 | |||
| 87fb8ee7b8 | |||
| 7c0dfe3eb5 |
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.4.3">2.4.3</a>
|
||||
#### 05/04/14
|
||||
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/pull/49">#49</a>.
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.4.2">2.4.2</a>
|
||||
#### 04/30/14
|
||||
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/pull/46">#46</a>.
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.4.1">2.4.1</a>
|
||||
#### 04/30/14
|
||||
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/pull/45">#45</a>.
|
||||
|
||||
## <a href="https://github.com/Jawbone/JBChartView/tree/v2.4.0">2.4.0</a>
|
||||
#### 04/28/14
|
||||
- Fixes issue <a href="https://github.com/Jawbone/JBChartView/pull/23">#23</a>.
|
||||
|
||||
@@ -266,9 +266,9 @@ static UIColor *kJBBarChartViewDefaultBarColor = nil;
|
||||
|
||||
- (CGFloat)minHeight
|
||||
{
|
||||
if (self.mininumValue != kJBChartViewUndefinedMinimumValue)
|
||||
if (self.minimumValue != kJBChartViewUndefinedMinimumValue)
|
||||
{
|
||||
return MIN(self.mininumValue, self.cachedMinHeight);
|
||||
return MIN(self.minimumValue, self.cachedMinHeight);
|
||||
}
|
||||
return self.cachedMinHeight;
|
||||
}
|
||||
@@ -398,13 +398,13 @@ static UIColor *kJBBarChartViewDefaultBarColor = nil;
|
||||
return _cachedMaxHeight;
|
||||
}
|
||||
|
||||
- (CGFloat)mininumValue
|
||||
- (CGFloat)minimumValue
|
||||
{
|
||||
if ([super mininumValue] == kJBChartViewUndefinedMinimumValue)
|
||||
if ([super minimumValue] == kJBChartViewUndefinedMinimumValue)
|
||||
{
|
||||
return self.cachedMinHeight;
|
||||
}
|
||||
return [super mininumValue];
|
||||
return [super minimumValue];
|
||||
}
|
||||
|
||||
- (CGFloat)maximumValue
|
||||
|
||||
@@ -51,7 +51,7 @@ typedef NS_ENUM(NSInteger, JBChartViewState){
|
||||
*
|
||||
* For min/max modifications to take effect, reloadData must be called.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat mininumValue;
|
||||
@property (nonatomic, assign) CGFloat minimumValue;
|
||||
@property (nonatomic, assign) CGFloat maximumValue;
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,7 +59,7 @@ static UIColor *kJBChartVerticalSelectionViewDefaultBgColor = nil;
|
||||
- (void)constructChartView
|
||||
{
|
||||
self.clipsToBounds = YES;
|
||||
_mininumValue = kJBChartViewUndefinedMinimumValue;
|
||||
_minimumValue = kJBChartViewUndefinedMinimumValue;
|
||||
_maximumValue = kJBChartViewUndefinedMaximumValue;
|
||||
}
|
||||
|
||||
@@ -138,10 +138,10 @@ static UIColor *kJBChartVerticalSelectionViewDefaultBgColor = nil;
|
||||
[self setState:state animated:NO];
|
||||
}
|
||||
|
||||
- (void)setMininumValue:(CGFloat)mininumValue
|
||||
- (void)setMinimumValue:(CGFloat)minimumValue
|
||||
{
|
||||
NSAssert(mininumValue >= 0, @"JBChartView // the minimumValue must be >= 0.");
|
||||
_mininumValue = mininumValue;
|
||||
NSAssert(minimumValue >= 0, @"JBChartView // the minimumValue must be >= 0.");
|
||||
_minimumValue = minimumValue;
|
||||
}
|
||||
|
||||
- (void)setMaximumValue:(CGFloat)maximumValue
|
||||
|
||||
+20
-20
@@ -24,7 +24,8 @@ CGFloat static const kJBLineChartLinesViewMiterLimit = -5.0;
|
||||
CGFloat static const kJBLineChartLinesViewDefaultLinePhase = 1.0f;
|
||||
CGFloat static const kJBLineChartLinesViewDefaultDimmedOpacity = 0.20f;
|
||||
NSInteger static const kJBLineChartLinesViewUnselectedLineIndex = -1;
|
||||
CGFloat static const kJBLineChartLinesViewSlopeThreshold = 0.01f;
|
||||
CGFloat static const kJBLineChartLinesViewSmoothThresholdSlope = 0.01f;
|
||||
NSInteger static const kJBLineChartLinesViewSmoothThresholdVertical = 1;
|
||||
|
||||
// Numerics (JBLineChartDotsView)
|
||||
NSInteger static const kJBLineChartDotsViewDefaultRadiusFactor = 3; // 3x size of line width
|
||||
@@ -401,9 +402,9 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
|
||||
- (CGFloat)minHeight
|
||||
{
|
||||
if (self.mininumValue != kJBChartViewUndefinedMinimumValue)
|
||||
if (self.minimumValue != kJBChartViewUndefinedMinimumValue)
|
||||
{
|
||||
return MIN(self.mininumValue, self.cachedMinHeight);
|
||||
return MIN(self.minimumValue, self.cachedMinHeight);
|
||||
}
|
||||
return self.cachedMinHeight;
|
||||
}
|
||||
@@ -723,13 +724,13 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
return _cachedMaxHeight;
|
||||
}
|
||||
|
||||
- (CGFloat)mininumValue
|
||||
- (CGFloat)minimumValue
|
||||
{
|
||||
if ([super mininumValue] == kJBChartViewUndefinedMinimumValue)
|
||||
if ([super minimumValue] == kJBChartViewUndefinedMinimumValue)
|
||||
{
|
||||
return self.cachedMinHeight;
|
||||
}
|
||||
return [super mininumValue];
|
||||
return [super minimumValue];
|
||||
}
|
||||
|
||||
- (CGFloat)maximumValue
|
||||
@@ -1057,9 +1058,7 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
|
||||
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];
|
||||
|
||||
CGFloat nextSlope = 0;
|
||||
CGFloat currentSlope = 0;
|
||||
|
||||
NSUInteger index = 0;
|
||||
NSArray *sortedLineData = [lineData sortedArrayUsingSelector:@selector(compare:)];
|
||||
for (JBLineChartPoint *lineChartPoint in sortedLineData)
|
||||
@@ -1070,19 +1069,20 @@ static UIColor *kJBLineChartViewDefaultDotSelectionColor = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (smoothLine == YES)
|
||||
JBLineChartPoint *nextLineChartPoint = nil;
|
||||
if (index != ([lineData count] - 1))
|
||||
{
|
||||
JBLineChartPoint *nextLineChartPoint = nil;
|
||||
if (index != ([lineData count] - 1))
|
||||
{
|
||||
nextLineChartPoint = [sortedLineData objectAtIndex:(index + 1)];
|
||||
}
|
||||
|
||||
nextSlope = (nextLineChartPoint != nil) ? ((nextLineChartPoint.position.y - lineChartPoint.position.y)) / ((nextLineChartPoint.position.x - lineChartPoint.position.x)) : previousSlope;
|
||||
currentSlope = ((lineChartPoint.position.y - previousLineChartPoint.position.y)) / (lineChartPoint.position.x-previousLineChartPoint.position.x);
|
||||
nextLineChartPoint = [sortedLineData objectAtIndex:(index + 1)];
|
||||
}
|
||||
|
||||
if (smoothLine && ((currentSlope >= (nextSlope + kJBLineChartLinesViewSlopeThreshold)) || (currentSlope <= (nextSlope - kJBLineChartLinesViewSlopeThreshold))))
|
||||
|
||||
CGFloat nextSlope = (nextLineChartPoint != nil) ? ((nextLineChartPoint.position.y - lineChartPoint.position.y)) / ((nextLineChartPoint.position.x - lineChartPoint.position.x)) : previousSlope;
|
||||
CGFloat currentSlope = ((lineChartPoint.position.y - previousLineChartPoint.position.y)) / (lineChartPoint.position.x-previousLineChartPoint.position.x);
|
||||
|
||||
BOOL deltaFromNextSlope = ((currentSlope >= (nextSlope + kJBLineChartLinesViewSmoothThresholdSlope)) || (currentSlope <= (nextSlope - kJBLineChartLinesViewSmoothThresholdSlope)));
|
||||
BOOL deltaFromPreviousSlope = ((currentSlope >= (previousSlope + kJBLineChartLinesViewSmoothThresholdSlope)) || (currentSlope <= (previousSlope - kJBLineChartLinesViewSmoothThresholdSlope)));
|
||||
BOOL deltaFromPreviousY = (lineChartPoint.position.y >= previousLineChartPoint.position.y + kJBLineChartLinesViewSmoothThresholdVertical) || (lineChartPoint.position.y <= previousLineChartPoint.position.y - kJBLineChartLinesViewSmoothThresholdVertical);
|
||||
|
||||
if (smoothLine && deltaFromNextSlope && deltaFromPreviousSlope && deltaFromPreviousY)
|
||||
{
|
||||
CGFloat deltaX = lineChartPoint.position.x - previousLineChartPoint.position.x;
|
||||
CGFloat controlPointX = previousLineChartPoint.position.x + (deltaX / 2);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "JBChartView"
|
||||
s.version = "2.4.0"
|
||||
s.version = "2.4.3"
|
||||
s.summary = "Jawbone's iOS-based charting library for both line and bar graphs."
|
||||
s.homepage = "https://github.com/Jawbone/JBChartView"
|
||||
|
||||
@@ -10,10 +10,10 @@ Pod::Spec.new do |s|
|
||||
s.author = { "Terry Worona" => "tworona@jawbone.com" }
|
||||
s.source = {
|
||||
:git => "https://github.com/Jawbone/JBChartView.git",
|
||||
:tag => "v2.4.0"
|
||||
:tag => "v2.4.3"
|
||||
}
|
||||
|
||||
s.platform = :ios, '7.0'
|
||||
s.source_files = 'Classes', 'Classes/**/*.{h,m}'
|
||||
s.source_files = 'Classes/**/*.{h,m}'
|
||||
s.requires_arc = true
|
||||
end
|
||||
Reference in New Issue
Block a user