Compare commits

..

8 Commits

Author SHA1 Message Date
terryworona 7944c03962 Merge pull request #209 from loumoore/master
Handle NaN line slope in line chart selection code.
2016-06-21 17:33:45 -07:00
Lou Moore e28a0113f8 PR feedback 2016-06-21 17:31:32 -07:00
Lou Moore 40ae91de47 Handle NaN line slope in line chart selection code. 2016-06-21 17:19:10 -07:00
terryworona 251b6e888f updated pod spec and change log 2016-05-30 19:35:38 -07:00
terryworona c2558f9975 Fixes 207 2016-05-30 19:30:42 -07:00
terryworona 2d1450340b updated pod spec and change log 2016-04-27 18:52:35 -07:00
terryworona 706dbc1859 fixed up documentation error 2016-04-27 18:49:47 -07:00
terryworona 6cce1ae272 Update change log and pod spec 2016-02-29 14:56:58 -08:00
5 changed files with 56 additions and 10 deletions
+26 -2
View File
@@ -1,8 +1,32 @@
# Change Log
## [Unreleased](https://github.com/Jawbone/JBChartView/tree/HEAD)
## [v3.0.10](https://github.com/Jawbone/JBChartView/tree/v3.0.10) (2016-05-31)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.9...v3.0.10)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.6...HEAD)
## [v3.0.9](https://github.com/Jawbone/JBChartView/tree/v3.0.9) (2016-04-28)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.8...v3.0.9)
**Implemented enhancements:**
- ability to set line chart view padding [\#205](https://github.com/Jawbone/JBChartView/issues/205)
**Fixed bugs:**
- old gradient fill shows if chart is scrolled offscreen [\#204](https://github.com/Jawbone/JBChartView/issues/204)
**Closed issues:**
- example of using gradient for fills [\#202](https://github.com/Jawbone/JBChartView/issues/202)
## [v3.0.8](https://github.com/Jawbone/JBChartView/tree/v3.0.8) (2016-02-29)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.7...v3.0.8)
**Fixed bugs:**
- Cannot change bar colors after initial load [\#201](https://github.com/Jawbone/JBChartView/issues/201)
## [v3.0.7](https://github.com/Jawbone/JBChartView/tree/v3.0.7) (2016-02-26)
[Full Changelog](https://github.com/Jawbone/JBChartView/compare/v3.0.6...v3.0.7)
**Closed issues:**
+22
View File
@@ -149,6 +149,28 @@ static UIColor *kJBBarChartViewDefaultBarColor = nil;
* Final block to refresh state and turn off reloading bit
*/
dispatch_block_t completionBlock = ^{
if (animated)
{
[self.chartData enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger index, BOOL * _Nonnull stop) {
// Grab old bar
UIView *oldBarView = [self.barViews objectAtIndex:index];
// Update bar instance
UIView *barView = [self createBarViewForIndex:index];
barView.frame = oldBarView.frame;
// Swap subviews
[oldBarView removeFromSuperview];
[self insertBarView:barView];
// Update bar colection
NSMutableArray *mutableBarViews = [NSMutableArray arrayWithArray:self.barViews];
[mutableBarViews replaceObjectAtIndex:index withObject:barView];
self.barViews = [NSArray arrayWithArray:mutableBarViews];
}];
}
self.reloading = NO;
[self setState:self.state animated:NO force:YES callback:nil];
};
+4 -4
View File
@@ -330,7 +330,7 @@ typedef NS_ENUM(NSInteger, JBLineChartViewColorStyle) {
/**
* Returns the selection color of a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default).
* As well, lineChartView:colorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default)
*
* Default: matches lineChartView:colorForLineAtLineIndex:.
*
@@ -344,7 +344,7 @@ typedef NS_ENUM(NSInteger, JBLineChartViewColorStyle) {
/**
* Returns the selection gradient layer of a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGradient.
* As well, lineChartView:colorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGradient.
*
* Note: gradients do not support multiple alphas. The alpha of gradient's first color be used throughout.
*
@@ -360,7 +360,7 @@ typedef NS_ENUM(NSInteger, JBLineChartViewColorStyle) {
/**
* Returns the selection fill color under a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionFillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default).
* As well, lineChartView:fillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleSolid (default).
*
* Default: matches lineChartView:fillColorForLineAtLineIndex:.
*
@@ -374,7 +374,7 @@ typedef NS_ENUM(NSInteger, JBLineChartViewColorStyle) {
/**
* Returns the selection fill gradient layer under a line within the chart during touch events.
* The property showsLineSelection must be YES for the color to apply.
* As well, lineChartView:selectionFillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGrdient.
* As well, lineChartView:fillColorStyleForLineAtLineIndex: must return JBLineChartViewColorStyleGrdient.
*
* Note: gradients do not support multiple alphas. The alpha of gradient's first color be used throughout.
*
+2 -2
View File
@@ -1035,8 +1035,8 @@ static NSInteger const kJBLineChartUnselectedLineIndex = -1;
// Touch point
CGPoint normalizedTouchPoint = CGPointMake(point.x, self.linesView.bounds.size.height - point.y);
// Slope
CGFloat lineSlope = (CGFloat)(rightPoint.y - leftPoint.y) / (CGFloat)(rightPoint.x - leftPoint.x);
// Slope - set to zero if x coordinates are the same and would result in a NaN value
CGFloat lineSlope = rightPoint.x != leftPoint.x ? (CGFloat)(rightPoint.y - leftPoint.y) / (CGFloat)(rightPoint.x - leftPoint.x) : 0.0f;
// Insersection point
CGPoint interesectionPoint = CGPointMake(normalizedTouchPoint.x, (lineSlope * (normalizedTouchPoint.x - leftPoint.x)) + leftPoint.y);
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "JBChartView"
s.version = "3.0.7"
s.version = "3.0.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 => "v3.0.7"
:tag => "v3.0.10"
}
s.platform = :ios, '6.0'