core data plot help!

Discussion in 'iOS Programming' started by ljg93, Mar 22, 2011.

  1. ljg93 macrumors member

    Joined:
    Mar 13, 2011
    #1
    hey guys i just put the core data plot into my app so the user can make a custom graph based on user information.. it is tracking someones weight..

    but when the user clicks the button to log the weight, the numbers on the y axis are too far apart from each other, so like if someone logs the weight 150 pounds, the x axis automatically starts around 140 then to 160 then 180 and 200, im looking for it to be something starting around 5 pound intervals from the original weight logged.. has anyone else had this problem? does anyone know how to fix it?
     
  2. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #2
    Screenshot? What framework/code are you using for the plot?

    I would have imagined the x axis to be time and the y axis to be weight, but obviously that is not what you are describing.

    B
     
  3. ljg93 thread starter macrumors member

    Joined:
    Mar 13, 2011
    #3
    PHP:

    ok heres a screen shot
     

    Attached Files:

  4. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
    As I expected, I see dates on the X axis (independent), weights on the Y axis (dependent). Not the other way around.

    What is it that you want to be done differently?

    B
     
  5. ljg93 thread starter macrumors member

    Joined:
    Mar 13, 2011
    #5
    im just wondering how i can get the dates on the x to not get all smashed together and how i can get the numbers on the y to be in increments of 5 from the first weight that was logged.
     
  6. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #6
    As I asked before: What framework or other code are you using to generate the plot?

    It must have some way to set the x and y axes. Without knowing what it is it becomes very hard to provide any help.

    Note that your test data is unrealistic. You've got all the dates on the same day and massive weight changes. You may want to test out your code with something a bit more "sane".

    B
     
  7. ljg93 thread starter macrumors member

    Joined:
    Mar 13, 2011
    #7
    http://code.google.com/p/core-plot/

    is where i got the sample code as far as the looks.

    i know the data is un realistic but i have tried it over a period of days and they still smash and the x axis gets generated after the first log and never moves after that. so it does not really matter...

    all my question is how can i get the increments in 5 not by 20 plus and have the dates no smush.
     
  8. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #8
    http://www.14oranges.com/2011/02/how-to-use-core-plot-for-ios/

    Try tweaking yRange and the major tick intervals to get things where you want them. You may also have to use a different formatter to have the dates not get smooshed.

    Build some fake data for testing don't rely on the app to do it for you. Take some different examples. Someone trying to lose weight, someone trying to gain and someone trying to stay the same.

    B
     
  9. ljg93 thread starter macrumors member

    Joined:
    Mar 13, 2011
    #9
    ok that explains a lot to me thanks! but if i posted my code that housed the x and y range could you tell me like some code to put in that spot to get me started? because right now i dont know where to begin on it really and where to start.
     
  10. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #10
    Post as much of your code as you feel comfortable with, preferably enough that it can be compiled and I'll definitely take a look at it at some point.

    B
     
  11. ljg93 thread starter macrumors member

    Joined:
    Mar 13, 2011
    #11
    is there anyway you could give me an email? i dont feel comfortable posting a compilable code on here
     
  12. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #12
    My account is e-mail enabled. Click on my name to the left.

    B
     

Share This Page