Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > XY graph

Reply
Thread Tools

XY graph

 
 
Grumps
Guest
Posts: n/a
 
      08-04-2010
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.


 
Reply With Quote
 
 
 
 
Ry Nohryb
Guest
Posts: n/a
 
      08-04-2010
On Aug 4, 10:07*pm, "Grumps" <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
Grumps
Guest
Posts: n/a
 
      08-04-2010
"Ry Nohryb" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On Aug 4, 10:07 pm, "Grumps" <(E-Mail Removed)> 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.


 
Reply With Quote
 
Grumps
Guest
Posts: n/a
 
      08-05-2010
"Richard Cornford" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?


 
Reply With Quote
 
Michael Haufe (\TNO\)
Guest
Posts: n/a
 
      08-05-2010
On Aug 4, 6:53*pm, "Richard Cornford" <(E-Mail Removed)>
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>
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      08-05-2010
In comp.lang.javascript message <i3ch9v$tdj$(E-Mail Removed)-
september.org>, Wed, 4 Aug 2010 21:07:08, Grumps <(E-Mail Removed)>
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)
 
Reply With Quote
 
Jesse
Guest
Posts: n/a
 
      08-05-2010
On Aug 6, 5:12*am, "Michael Haufe (\"TNO\")"
<(E-Mail Removed)> wrote:
> On Aug 4, 6:53*pm, "Richard Cornford" <(E-Mail Removed)>
> 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/
 
Reply With Quote
 
Jesse
Guest
Posts: n/a
 
      08-05-2010
On Aug 6, 5:12*am, "Michael Haufe (\"TNO\")"
<(E-Mail Removed)> wrote:
> On Aug 4, 6:53*pm, "Richard Cornford" <(E-Mail Removed)>
> 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/
 
Reply With Quote
 
Ry Nohryb
Guest
Posts: n/a
 
      08-05-2010
On Aug 4, 11:42*pm, "Grumps" <(E-Mail Removed)> wrote:
> "Ry Nohryb" <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Boost Graph Library to create very large graph Almoni C++ 0 01-17-2010 05:13 AM
[Boost.Graph] graph.vertices property creates new objects George Sakkis Python 1 01-29-2007 11:09 PM
Help with initialization of graph (Boost Graph Library) Jef Driesen C++ 3 01-24-2006 01:44 PM
Missing Graph.h and (Graph.lib) woes - any help Dr Ann Huxtable C Programming 6 12-21-2004 11:15 AM
GD::Graph: "mixed" graph doesn't recognize "area" graph type Emilio Mayorga Perl Misc 6 10-08-2003 02:14 AM



Advertisments