Skip to content

Commit

Permalink
Adding dot color as a property to the graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Shi committed Mar 17, 2014
1 parent bd1f65b commit 6618e35
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions Classes/BEMCircle.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
@interface BEMCircle : UIView

@property (assign, nonatomic) BOOL shouldDisplayConstantly;
@property (strong, nonatomic) UIColor *dotColor;

@end
6 changes: 5 additions & 1 deletion Classes/BEMCircle.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ - (id)initWithFrame:(CGRect)frame {
- (void)drawRect:(CGRect)rect {
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextAddEllipseInRect(ctx, rect);
[[UIColor whiteColor] set];
if (self.dotColor) {
[self.dotColor set];
} else {
[[UIColor whiteColor] set];
}
CGContextFillPath(ctx);
}

Expand Down
2 changes: 2 additions & 0 deletions Classes/BEMSimpleLineGraphView.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
/// Color of the label's text displayed on the X-Axis.
@property (strong, nonatomic) UIColor *colorXaxisLabel;

@property (strong, nonatomic) UIColor *colorDot;



@end
Expand Down
1 change: 1 addition & 0 deletions Classes/BEMSimpleLineGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ - (void)drawDots {
else positionOnYAxis = (self.frame.size.height - padding) - ((dotValue - minValue) / ((maxValue - minValue) / (self.frame.size.height - padding))) + 30;

BEMCircle *circleDot = [[BEMCircle alloc] initWithFrame:CGRectMake(0, 0, circleSize, circleSize)];
circleDot.dotColor = self.colorDot;
circleDot.center = CGPointMake(positionOnXAxis, positionOnYAxis);
circleDot.tag = i+100;
circleDot.alpha = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>457E64A4-0E5A-4481-A6A9-8F500C03772B</string>
<string>E8B03279-430A-4B24-8F57-FBED143BE5A9</string>
<key>IDESourceControlProjectName</key>
<string>SimpleLineChart</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>2F6E04DE-2EF3-4A54-8C8C-A717A1D70D4E</key>
<string>https://github.com/Boris-Em/BEMSimpleLineGraph.git</string>
<key>9FBC0458-7BFD-4272-98B0-F90F66026C2E</key>
<string>https://github.com/ideo-digital-shop/BEMSimpleLineGraph.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>2F6E04DE-2EF3-4A54-8C8C-A717A1D70D4E</key>
<key>9FBC0458-7BFD-4272-98B0-F90F66026C2E</key>
<string>../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/Boris-Em/BEMSimpleLineGraph.git</string>
<string>https://github.com/ideo-digital-shop/BEMSimpleLineGraph.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>2F6E04DE-2EF3-4A54-8C8C-A717A1D70D4E</string>
<string>9FBC0458-7BFD-4272-98B0-F90F66026C2E</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>2F6E04DE-2EF3-4A54-8C8C-A717A1D70D4E</string>
<string>9FBC0458-7BFD-4272-98B0-F90F66026C2E</string>
<key>IDESourceControlWCCName</key>
<string>BEMSimpleLineGraph</string>
</dict>
Expand Down

0 comments on commit 6618e35

Please sign in to comment.