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

X-Axis label displays under the graph view #47

Closed
Boris-Em opened this issue Jun 29, 2014 · 1 comment
Closed

X-Axis label displays under the graph view #47

Boris-Em opened this issue Jun 29, 2014 · 1 comment
Labels
Milestone

Comments

@Boris-Em
Copy link
Owner

When numberOfGapsBetweenLabelsOnLineGraph returns the number of points in the graph, the X-Axis labels are displayed under the graph view.

screenshot

@Boris-Em Boris-Em added this to the Version 3.0 milestone Jun 29, 2014
@Sam-Spencer Sam-Spencer changed the title X-Axis lables displayes under the graph view X-Axis label displays under the graph view Jul 3, 2014
@Sam-Spencer Sam-Spencer removed this from the Version 3.0 milestone Jul 3, 2014
@Sam-Spencer
Copy link
Collaborator

Can confirm that this is not an issue on the master branch. It was introduced in commit c152bb6 on the feature branch.

The issue seems to be related to line 517 and 530 in the drawXAxis method. The following code causes the labels to be drawn too far below the graph:

UILabel *firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(3+labelYaxisOffset, self.frame.size.height, viewWidth/2, 20)];
UILabel *lastLabel = [[UILabel alloc] initWithFrame:CGRectMake(viewWidth/2 - 3, self.frame.size.height, viewWidth/2, 20)];

By modifying the code (and thereby reversing the changes made in commit c152bb6), the labels are drawn on the graph. However, a new issue arises in its place: the X-Axis frame is drawn below the labels rather than above them.

EDIT

The issue with the X-Axis Reference Frame was caused by two missing lines of code. The labels were not being added to the xAxisLabels array. Simply adding these two lines and reversing the changes on the previously mentioned commit fixed the issue:

[xAxisLabels addObject:firstLabel];
[xAxisLabels addObject:lastLabel];

@Sam-Spencer Sam-Spencer added this to the Version 3.0 milestone Jul 15, 2014
@Sam-Spencer Sam-Spencer added fixed and removed todo labels Jul 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants