Skip to content

GKLineGraph - TitleLabels dynamic width #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hons82
Copy link

@hons82 hons82 commented Aug 28, 2014

That's really a great library, that's why I'm using it in my APP�.

However, the reason why I forked it was that I had to put real dates (e.g. 29/08/14) as title label which is wider than the Label width, which results in being cropped (e.g. 29/08/...)

  1. I was able to change your code to calculate the width dynamically, so now It's showing all.
  2. If the values of the points was really really low it could happen that by "ceil"ing the value you got just a "0" on the Y-Axis or worse 2 "0" (which should probably be something like 0.1 and 0.3 that was converted into "0" and "0" with the "ceil" command. I found a solution to work there with fractions and give them a reasonable length. However it might not always be what the user expects, so you could probably add a setting e.g."isYLableFraction" and show it fractionated only if its really set by the user.
  3. If all values in the array are the same("e.g all "0"s or all "1"s) then your not able to calculate the position of the line and it will crash. this can be avoided with my implementation of - (CGFloat)_maxValue. Again it might not be the best solution to simply add 1 if all values are equal but... it works :-D

hons82 added 2 commits August 12, 2014 12:14
- Fractions as values for Y line
- No crash if all values are == 0
Add latest changes from base repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants