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

Commit 040d87c

Browse files
committed
Add gradient properties to BEMLine and BEMSimpleLineGraphView classes
1 parent 7baa81d commit 040d87c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Classes/BEMLine.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,15 @@ typedef NS_ENUM(NSInteger, BEMLineAnimation) {
7979
/// The color of the area above the line, inside of its superview
8080
@property (strong, nonatomic) UIColor *topColor;
8181

82+
/// A color gradient applied to the area above the line, inside of its superview. If set, it will be drawn on top of the fill from the \p topColor property.
83+
@property (assign, nonatomic) CGGradientRef topGradient;
84+
8285
/// The color of the area below the line, inside of its superview
8386
@property (strong, nonatomic) UIColor *bottomColor;
8487

88+
/// A color gradient applied to the area below the line, inside of its superview. If set, it will be drawn on top of the fill from the \p bottomColor property.
89+
@property (assign, nonatomic) CGGradientRef bottomGradient;
90+
8591
@property (strong, nonatomic) UIColor *xAxisBackgroundColor;
8692

8793
@property (nonatomic) CGFloat xAxisBackgroundAlpha;

Classes/BEMSimpleLineGraphView.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@
197197
@property (nonatomic) CGFloat alphaBottom;
198198

199199

200+
/// Fill gradient of the bottom part of the graph (between the line and the X-axis). When set, it will draw a gradient over top of the fill provided by the \p colorBottom and \p alphaBottom properties.
201+
@property (assign, nonatomic) CGGradientRef gradientBottom;
202+
203+
200204
/// Color of the top part of the graph (between the line and the top of the view the graph is drawn in).
201205
@property (strong, nonatomic) UIColor *colorTop;
202206

@@ -205,6 +209,9 @@
205209
@property (nonatomic) CGFloat alphaTop;
206210

207211

212+
/// Fill gradient of the top part of the graph (between the line and the top of the view the graph is drawn in). When set, it will draw a gradient over top of the fill provided by the \p colorTop and \p alphaTop properties.
213+
@property (assign, nonatomic) CGGradientRef gradientTop;
214+
208215
/// Color of the line of the graph.
209216
@property (strong, nonatomic) UIColor *colorLine;
210217

Classes/BEMSimpleLineGraphView.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ - (void)drawLine {
441441
line.bottomColor = self.colorBottom;
442442
line.topAlpha = self.alphaTop;
443443
line.bottomAlpha = self.alphaBottom;
444+
line.topGradient = self.gradientTop;
445+
line.bottomGradient = self.gradientBottom;
444446
line.lineWidth = self.widthLine;
445447
line.lineAlpha = self.alphaLine;
446448
line.bezierCurveIsEnabled = self.enableBezierCurve;

0 commit comments

Comments
 (0)