Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 81fcbd7

Browse files
author
Sam Spencer
committed
Dot Color Behavior Update
As suggested in PR #121, because graph dot alpha is not an editable property, the default internal value is now 1.0 (100%). You may change the alpha of dots by specifying a UIColor for the `colorPoint` property with an alpha value. The new default value of `colorPoint` is white at 0.7 (70%) alpha.
1 parent 61e9e7d commit 81fcbd7

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

Classes/BEMSimpleLineGraphView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ IB_DESIGNABLE @interface BEMSimpleLineGraphView : UIView <UIGestureRecognizerDel
282282
@property (nonatomic) IBInspectable CGFloat sizePoint;
283283

284284

285-
/// The color of the circles that represent each point. Default is white.
285+
/// The color of the circles that represent each point. Default is white at 70% alpha.
286286
@property (strong, nonatomic) IBInspectable UIColor *colorPoint;
287287

288288

Classes/BEMSimpleLineGraphView.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ - (void)commonInit {
151151
_colorTop = [UIColor colorWithRed:0 green:122.0/255.0 blue:255/255 alpha:1];
152152
_colorLine = [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1];
153153
_colorBottom = [UIColor colorWithRed:0 green:122.0/255.0 blue:255/255 alpha:1];
154-
_colorPoint = [UIColor whiteColor];
154+
_colorPoint = [UIColor colorWithWhite:1.0 alpha:0.7];
155155
_colorTouchInputLine = [UIColor grayColor];
156156
_colorBackgroundPopUplabel = [UIColor whiteColor];
157157
_alphaTouchInputLine = 0.2;
@@ -540,13 +540,12 @@ - (void)drawDots {
540540
if (self.displayDotsOnly == YES) circleDot.alpha = 1.0;
541541
else {
542542
if (self.alwaysDisplayDots == NO) circleDot.alpha = 0;
543-
else circleDot.alpha = 0.7;
543+
else circleDot.alpha = 1.0;
544544
}
545545
} else {
546546
if (self.displayDotsWhileAnimating) {
547547
[UIView animateWithDuration:(float)self.animationGraphEntranceTime/numberOfPoints delay:(float)i*((float)self.animationGraphEntranceTime/numberOfPoints) options:UIViewAnimationOptionCurveLinear animations:^{
548-
if (self.displayDotsOnly == YES) circleDot.alpha = 1.0;
549-
else circleDot.alpha = 0.7;
548+
circleDot.alpha = 1.0;
550549
} completion:^(BOOL finished) {
551550
if (self.alwaysDisplayDots == NO && self.displayDotsOnly == NO) {
552551
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{

Sample Project/SimpleLineChart/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="j8C-nX-jcI">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="j8C-nX-jcI">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
66
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
77
</dependencies>
88
<scenes>

0 commit comments

Comments
 (0)