XY graph

Discussion in 'Javascript' started by Grumps, Aug 4, 2010.

  1. Grumps

    Grumps Guest

    Hi all.
    This should be simple, but I'm trying to find a js that will draw a simple
    line graph.
    I've googled and found loads, and tried several too, but they all lack the
    basic requirements.
    1) Need to enter x,y coords.
    2) Need to be able to define x and y axis upper and lower limits.
    3) Need to be able to label and number the axes.
    4) Needs to work with FF, Opera, Chrome, Safari and IE (from 6 up).
    5) Doesn't have to be free.

    http://danvk.org/dygraphs/ is the closest, but I can't find how to set the
    axes' values. I'd like hours along the x-axis in steps of 6 hours.
    TIA for any suggestions.
    Grumps, Aug 4, 2010
    #1
    1. Advertising

  2. Grumps

    Ry Nohryb Guest

    On Aug 4, 10:07 pm, "Grumps" <> wrote:
    > (...)
    > http://danvk.org/dygraphs/is the closest, but I can't find how to set the
    > axes' values. I'd like hours along the x-axis in steps of 6 hours.
    > TIA for any suggestions.


    But it renders in a <canvas> and that's not in any IE...
    There's a <canvas> plugin/extension for IEs but last time I tried it
    it was a complete disaster. And IMO it's not a very good thing to ask
    the users to install a plugin to see your page, or is it? I think that
    your options are:

    Drop IE from the list and use a <canvas> and/or a library such as
    http://raphaeljs.com/ (SVG) or any other.

    or

    use flash,

    or

    build the graphs on the server, e.g. http://code.google.com/apis/chart/

    or

    draw the pixels as <td>s in a <table>, e.g. http://jorgechamorro.com/cljs/028/

    HTH,
    --
    Jorge.
    Ry Nohryb, Aug 4, 2010
    #2
    1. Advertising

  3. Grumps

    Grumps Guest

    "Ry Nohryb" <> wrote in message
    news:...
    On Aug 4, 10:07 pm, "Grumps" <> wrote:
    >> (...)
    >> http://danvk.org/dygraphs/is the closest, but I can't find how to set the
    >> axes' values. I'd like hours along the x-axis in steps of 6 hours.
    >> TIA for any suggestions.


    >But it renders in a <canvas> and that's not in any IE...
    >There's a <canvas> plugin/extension for IEs but last time I tried it
    >it was a complete disaster. And IMO it's not a very good thing to ask
    >the users to install a plugin to see your page, or is it?


    100% not a good idea for my customers.

    >I think that
    >your options are:


    >Drop IE from the list and use a <canvas> and/or a library such as
    >http://raphaeljs.com/ (SVG) or any other.


    Raphael looks nice and easy. It does seem to work with IE8. Should it work?

    >use flash,


    Ah, it needs to run on an iPhone (no flash).

    >build the graphs on the server, e.g. http://code.google.com/apis/chart/
    >draw the pixels as <td>s in a <table>, e.g.
    >http://jorgechamorro.com/cljs/028/


    I'll look into both of those too.

    >HTH,


    It does. Thank you.
    Grumps, Aug 4, 2010
    #3
  4. Grumps

    Grumps Guest

    "Richard Cornford" <> wrote in message
    news:...
    > Grumps wrote:
    >> Ry Nohryb wrote<snip>
    >>> Drop IE from the list and use a <canvas> and/or a library
    >>> such as
    >>> http://raphaeljs.com/ (SVG) or any other.

    >>
    >> Raphael looks nice and easy. It does seem to work with IE8.

    >
    > Did you mean "it doesn't seem to work with IE8"? Otherwise you next
    > question doesn't make much sense.


    No. It DOES work. I'm only drawing vectors and circles.

    >> Should it work?

    > <snip>
    >
    > IE 8 has an 'interesting' feature where it will not do VML on a page in
    > 'standards' mode, only on pages in 'quirks' mode. As IE 8 doesn't do SVG
    > Raphael will only work on IE 8 in 'quirks' mode.


    Then I guess IE8's quirks mode is good enough to render my Raphael output.

    > Unfortunately that makes the <canvas> emulations that uses VML for its
    > emulation on IE significantly less viable.


    You mean that it shouldn't work?
    Grumps, Aug 5, 2010
    #4
  5. On Aug 4, 6:53 pm, "Richard Cornford" <>
    wrote:

    > IE 8 has an 'interesting' feature where it will not do VML on a page in
    > 'standards' mode, only on pages in 'quirks' mode. As IE 8 doesn't do SVG
    > Raphael will only work on IE 8 in 'quirks' mode.


    IE8 Standards Mode + VML seems to work just fine:

    <!DOCTYPE html>
    <html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <style type="text/css">
    v\:rect{
    behavior:url(#default#VML);
    display:inline-block;
    width:100px;
    height:100px;
    }
    </style>
    </head>
    <body>
    <v:rect fillcolor="green" />
    </body>
    </html>
    Michael Haufe (\TNO\), Aug 5, 2010
    #5
  6. In comp.lang.javascript message <i3ch9v$tdj$-
    september.org>, Wed, 4 Aug 2010 21:07:08, Grumps <>
    posted:

    >This should be simple, but I'm trying to find a js that will draw a simple
    >line graph.
    >I've googled and found loads, and tried several too, but they all lack the
    >basic requirements.
    >1) Need to enter x,y coords.
    >2) Need to be able to define x and y axis upper and lower limits.
    >3) Need to be able to label and number the axes.
    >4) Needs to work with FF, Opera, Chrome, Safari and IE (from 6 up).
    >5) Doesn't have to be free.



    All that can be done with a canvas, provided that you invert the 6 for
    IE.

    An occasional poster here has commended something else, which I read
    about in Wikipedia; if I could recall what it's called, I'd say. Aha! :
    <http://en.wikipedia.org/wiki/HTML_canvas> links to
    <http://en.wikipedia.org/wiki/Scalable_Vector_Graphics>. SVG. IE9.

    If, however, you can settle for a histogram style - and histograms can
    have thin bars - or for just dots plus horizontal and vertical lines,
    then study <URL:http://www.merlyn.demon.co.uk/js-misc1.htm> for ideas

    --
    (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (RFCs 5536/7)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (RFCs 5536/7)
    Dr J R Stockton, Aug 5, 2010
    #6
  7. Grumps

    Jesse Guest

    On Aug 6, 5:12 am, "Michael Haufe (\"TNO\")"
    <> wrote:
    > On Aug 4, 6:53 pm, "Richard Cornford" <>
    > wrote:
    >
    > > IE 8 has an 'interesting' feature where it will not do VML on a page in
    > > 'standards' mode, only on pages in 'quirks' mode. As IE 8 doesn't do SVG
    > > Raphael will only work on IE 8 in 'quirks' mode.

    >
    > IE8 Standards Mode + VML seems to work just fine:
    >
    > <!DOCTYPE html>
    > <html xmlns:v="urn:schemas-microsoft-com:vml">
    >   <head>
    >     <style type="text/css">
    >       v\:rect{
    >         behavior:url(#default#VML);
    >         display:inline-block;
    >         width:100px;
    >         height:100px;
    >       }
    >     </style>
    >   </head>
    >   <body>
    >     <v:rect fillcolor="green" />
    >   </body>
    > </html>


    Not sure if you've seen flot?
    Very good javascript graphing library, uses canvas for non IE and uses
    excanvas for IE. Haven't had any problems with it in IE
    http://code.google.com/p/flot/
    Jesse, Aug 5, 2010
    #7
  8. Grumps

    Jesse Guest

    On Aug 6, 5:12 am, "Michael Haufe (\"TNO\")"
    <> wrote:
    > On Aug 4, 6:53 pm, "Richard Cornford" <>
    > wrote:
    >
    > > IE 8 has an 'interesting' feature where it will not do VML on a page in
    > > 'standards' mode, only on pages in 'quirks' mode. As IE 8 doesn't do SVG
    > > Raphael will only work on IE 8 in 'quirks' mode.

    >
    > IE8 Standards Mode + VML seems to work just fine:
    >
    > <!DOCTYPE html>
    > <html xmlns:v="urn:schemas-microsoft-com:vml">
    >   <head>
    >     <style type="text/css">
    >       v\:rect{
    >         behavior:url(#default#VML);
    >         display:inline-block;
    >         width:100px;
    >         height:100px;
    >       }
    >     </style>
    >   </head>
    >   <body>
    >     <v:rect fillcolor="green" />
    >   </body>
    > </html>


    Not sure if you've seen flot?
    Very good javascript graphing library, uses canvas for non IE and uses
    excanvas for IE. Haven't had any problems with it in IE
    http://code.google.com/p/flot/
    Jesse, Aug 5, 2010
    #8
  9. Grumps

    Ry Nohryb Guest

    On Aug 4, 11:42 pm, "Grumps" <> wrote:
    > "Ry Nohryb" <> wrote in message
    > (...)
    > >HTH,

    >
    > It does. Thank you.


    You're welcome.
    I for one would use the <canvas> thingy: http://jorgechamorro.com/cljs/102/
    So sorry that Microsoft doesn't want us to use it :)
    --
    Jorge.
    Ry Nohryb, Aug 6, 2010
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Sakkis
    Replies:
    1
    Views:
    436
    Szabolcs Nagy
    Jan 29, 2007
  2. Dr Ann Huxtable

    Missing Graph.h and (Graph.lib) woes - any help

    Dr Ann Huxtable, Dec 21, 2004, in forum: C Programming
    Replies:
    6
    Views:
    630
    Dr Ann Huxtable
    Dec 21, 2004
  3. Jef Driesen
    Replies:
    3
    Views:
    2,531
    mlimber
    Jan 24, 2006
  4. Almoni
    Replies:
    0
    Views:
    3,085
    Almoni
    Jan 17, 2010
  5. Emilio Mayorga
    Replies:
    6
    Views:
    319
    Martien Verbruggen
    Oct 8, 2003
Loading...

Share This Page