diff --git a/Classes/BEMSimpleLineGraphView.m b/Classes/BEMSimpleLineGraphView.m index fe34477..fa392f9 100644 --- a/Classes/BEMSimpleLineGraphView.m +++ b/Classes/BEMSimpleLineGraphView.m @@ -216,7 +216,7 @@ - (void)drawDots { positionOnXAxis = (self.frame.size.width/(numberOfPoints - 1))*i; if (minValue == maxValue) positionOnYAxis = self.frame.size.height/2; - else positionOnYAxis = (self.frame.size.height - padding) - ((dotValue - minValue) / ((maxValue - minValue) / (self.frame.size.height - padding))) + 20; + 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.center = CGPointMake(positionOnXAxis, positionOnYAxis); diff --git a/README.md b/README.md index 2964341..1699ae8 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ Informs how much empty space is needed between each displayed label. Returning 0 The text to be displayed for each UILabel on the X-Axis at a given index. It should return as many strings as the number of points on the graph. - (NSString *)lineGraph:(BEMSimpleLineGraphView *)graph labelOnXAxisForIndex:(NSInteger)index { - return X; + return …; } **X-Axis Label Color** @@ -200,7 +200,7 @@ BEMSimpleLineGraphs are split into three parts - the top, the bottom, and the li * Line. The `colorLine` and `alphaLine` properties control the color (UIColor) and alpha (float) of the line of the graph. The `widthLine` property controls the width of the line of graph (float that defaults to 1.0). ### Graph Snapshots -On iOS 7.0 and above you can take a snapshot of the line graph view and get a UIImage representation of the snapshot. To do so, simply call the method below at anytime in the graph's lifecycle. Note that the snapshot is not of the completed graph, but of the graph in its current state (whether it is in mid-animation or not). You can use the `lineGraphDidFinishLoading:` delegate method (coming soon) to find out when the graph has finished rendering and animating. +On iOS 7.0 and above you can take a snapshot of the line graph view and get a UIImage representation of the snapshot. To do so, simply call the method below at anytime in the graph's lifecycle. Note that the snapshot is not of the completed graph, but of the graph in its current state (whether it is in mid-animation or not). You can use the `lineGraphDidFinishLoading:` delegate method to find out when the graph has finished rendering and animating. // Method Definition - (UIImage *)graphSnapshotImage; diff --git a/Sample Project/SimpleLineChart.xcodeproj/project.pbxproj b/Sample Project/SimpleLineChart.xcodeproj/project.pbxproj index dd6f776..4fc953b 100644 --- a/Sample Project/SimpleLineChart.xcodeproj/project.pbxproj +++ b/Sample Project/SimpleLineChart.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ 99B15643187B412400B24591 /* StatsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 99B15642187B412400B24591 /* StatsViewController.m */; }; 99B3FA3A1877898B00539A7B /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 99B3FA381877898B00539A7B /* LICENSE */; }; 99B3FA3B1877898B00539A7B /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 99B3FA391877898B00539A7B /* README.md */; }; - C310075C18A60C0800F60845 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = C310075B18A60C0800F60845 /* LICENSE */; }; C3B90A5E187D15F7003E407D /* BEMAnimations.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B90A57187D15F7003E407D /* BEMAnimations.m */; }; C3B90A5F187D15F7003E407D /* BEMCircle.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B90A59187D15F7003E407D /* BEMCircle.m */; }; C3B90A60187D15F7003E407D /* BEMLine.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B90A5B187D15F7003E407D /* BEMLine.m */; }; @@ -21,7 +20,6 @@ C3FD8163186DFD9A00FD8ED3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C3FD8161186DFD9A00FD8ED3 /* InfoPlist.strings */; }; C3FD8165186DFD9A00FD8ED3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C3FD8164186DFD9A00FD8ED3 /* main.m */; }; C3FD8169186DFD9A00FD8ED3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C3FD8168186DFD9A00FD8ED3 /* AppDelegate.m */; }; - C3FD816C186DFD9A00FD8ED3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3FD816A186DFD9A00FD8ED3 /* Main.storyboard */; }; C3FD816F186DFD9A00FD8ED3 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C3FD816E186DFD9A00FD8ED3 /* ViewController.m */; }; C3FD8171186DFD9A00FD8ED3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3FD8170186DFD9A00FD8ED3 /* Images.xcassets */; }; C3FD8178186DFD9A00FD8ED3 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3FD8177186DFD9A00FD8ED3 /* XCTest.framework */; }; @@ -46,7 +44,6 @@ 99B15642187B412400B24591 /* StatsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatsViewController.m; sourceTree = ""; }; 99B3FA381877898B00539A7B /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 99B3FA391877898B00539A7B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; - C310075B18A60C0800F60845 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; C3B90A56187D15F7003E407D /* BEMAnimations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BEMAnimations.h; sourceTree = ""; }; C3B90A57187D15F7003E407D /* BEMAnimations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BEMAnimations.m; sourceTree = ""; }; C3B90A58187D15F7003E407D /* BEMCircle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BEMCircle.h; sourceTree = ""; }; @@ -274,8 +271,6 @@ C3FD8171186DFD9A00FD8ED3 /* Images.xcassets in Resources */, 99B3FA3B1877898B00539A7B /* README.md in Resources */, C3FD8163186DFD9A00FD8ED3 /* InfoPlist.strings in Resources */, - C3FD816C186DFD9A00FD8ED3 /* Main.storyboard in Resources */, - C310075C18A60C0800F60845 /* LICENSE in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate b/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate index 5705366..965bb08 100644 Binary files a/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate and b/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Sample Project/SimpleLineChart/ViewController.m b/Sample Project/SimpleLineChart/ViewController.m index 9685f2b..f3f77bc 100644 --- a/Sample Project/SimpleLineChart/ViewController.m +++ b/Sample Project/SimpleLineChart/ViewController.m @@ -31,7 +31,7 @@ - (void)viewDidLoad { previousStepperValue = self.graphObjectIncrement.value; totalNumber = 0; - for (int i = 0; i < 11; i++) { + for (int i = 0; i < 9; i++) { [self.ArrayOfValues addObject:[NSNumber numberWithInteger:(arc4random() % 70000)]]; // Random values for the graph [self.ArrayOfDates addObject:[NSString stringWithFormat:@"%@",[NSNumber numberWithInt:2000 + i]]]; // Dates for the X-Axis of the graph