Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how to create line graph

    hi all
    i am working on a web page that displays a predicted temperature curve given the daily high and low. So far, I have the two values and the formula to generate temperature
    values of every hour of the day, so I have 24 values, and I want to display the results as a smooth curve using JavaScript. I have seen some existing examples on creating Bar graphs, but that doesn't help me much. If anyone can give me some
    suggestions and pointers to get started, it will be great!

    thanks!

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Round Rock, Texas
    Posts
    443
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can't give you specifics for solving your problem but let me just say I strongly suspect javascript is not up to the task. My fuzzy rememberances of doing curve fitting in an upper-level computer science course is that it was dripping with calculus and it takes a computer language like FORTRAN that's designed for handling heavy-duty math stuff.

    Maybe the National Weather Service or National Oceanographic and Atmospheric Administration (NOAA) might be able to help. Couldn't hurt to ask! Maybe they have some reasonably simplistic algorithms for use by the weatherman wannabe.

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Are you talking about doing regressions on the data, then creating a single line/power curve/quadratic/something else for the data? If so, that'll be some calculus...

    If you just mean smoothly connecting data points, I'd look into SVG and more particularly a <path/> element.
    http://www.w3.org/TR/SVG11/paths.html

  • #4
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks!

    I guess it might not be possible in JavaScript. I ended up using Flash MX's chart component, and it turns out great. I just need a simple curve that represents different data points, so FLash is close enough, i guess.

    Thanks for your suggestions!

    catherine


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •