473,732 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple 2d graphing in web page - where to begin

My Googling has let me down here - maybe because when it comes to Java
I don't really know which type I need! If someone could point me in
the right direction I'd appreciate it.

My requirement is simple: to display a 2-d graph within a web page
where the X and Y values are taken from a database (residing on the
server hosting the web pages). The GUI is to allow panning forwards
and backwards over time (the X values are 32-bit timestamps) and
zooming in and out. That's about it. It would be a bonus if there were
a time display of the cursor position as it is moved over the image.

Java noob question: what /type/ of Java would I need? I see there are
applets, servlets, beans and swing components... oh and Javascript
thrown in to the equation. I don't know where to begin!

I notice that IE warns about the security of some embedded components
but not others. Anyone know what makes the difference?

Is there any existing code that will do the 2-d graphing, as above,
that I could modify? Is there an existing package that will do all of
what I want? It seems a pretty basic requirement.

Lastly, and thanks for staying with me, could you recommend any books
that would provide suitable source code - e.g. a Java or Javascript
cookbook?
--
TIA,
James

Jan 29 '07 #1
7 1950
"James Harris" <ja************ @googlemail.com wrote in message
news:11******** **************@ m58g2000cwm.goo glegroups.com.. .
My requirement is simple: to display a 2-d graph within a web page
where the X and Y values are taken from a database (residing on the
server hosting the web pages). The GUI is to allow panning forwards
and backwards over time (the X values are 32-bit timestamps) and
zooming in and out. That's about it. It would be a bonus if there were
a time display of the cursor position as it is moved over the image.

Java noob question: what /type/ of Java would I need? I see there are
applets, servlets, beans and swing components... oh and Javascript
thrown in to the equation. I don't know where to begin!
Well, I believe either approach is theoretically possible. I know firsthand I have seen
applets (class files) performing that type of thing here:

http://www.analyzemath.com/Calculators.html

As such, rather than begin learning a slew of DHTML, I would recommend you take this
question to:

comp.lang.java

Also, avoid multiposting. It is lazy (and rude?) and people would respond to you thusly
I notice that IE warns about the security of some embedded components
but not others. Anyone know what makes the difference?
After updating to SP2 in Windows XP I get the:

"Internet Explorer has restricted this file from showing active content that could access
your computer."

....whether I am running a JavaScript, a VBScript, ActiveX, or Java applet.
Is there any existing code that will do the 2-d graphing, as above,
that I could modify? Is there an existing package that will do all of
what I want? It seems a pretty basic requirement.
If there is, Google would surely find it for you.
Lastly, and thanks for staying with me, could you recommend any books
that would provide suitable source code - e.g. a Java or Javascript
cookbook?

http://www.oreillynet.com/pub/au/156

David Flanagan's "JavaScript : The Definitive Guide 5th Edition" seems to be the wisest
choice. Had I the money this is the book I would upgrade my 3rd Edition to.

Hope this helps a bit.

-Lost
Jan 29 '07 #2
On 29 Jan, 01:36, "Daniel Pitts" <googlegrou...@ coloraura.comwr ote:
....
JamesThis really sounds like a good place for a multi-tier solution. You
would have a server or servlet application that access the database,
and a client side application (maybe using Applet or Java Web Start)
that renders the graphs.
I guess keeping the database with the web server would allow just two
tiers and thus keep it simpler. My overriding goal at the mo! I can
add features later. Never heard of Java Web Start but it sounds
promising.
It might actually be better to make the front-end a Flash file if you
are more concerned with "pretty rendering" than business logic on the
front end. If the display were more static, you might consider using
a servlet to render it server side, and not worry about client-side
applications.
All I need is a rectangle and some ways to influence what the
rectangle displays. The simpler the better.
There are really a lot of options for this. I personally would
probably start with a pure servlet/jsp implementation, which rendered
an html page and a PNG image using java imageio. Mostly because thats
what I already know.
Wow! JSP is another option, then? I guess there are just too many
options. When I wrote some stuff in Java years ago I spent most of the
time looking for and learning how to work with what other people had
written than writing code myself. I guess that's even more the need
now!

Jan 29 '07 #3
James Harris wrote:
My Googling has let me down here - maybe because when it comes to Java
I don't really know which type I need! If someone could point me in
the right direction I'd appreciate it.

My requirement is simple: to display a 2-d graph within a web page
where the X and Y values are taken from a database (residing on the
server hosting the web pages). The GUI is to allow panning forwards
and backwards over time (the X values are 32-bit timestamps) and
zooming in and out. That's about it. It would be a bonus if there were
a time display of the cursor position as it is moved over the image.

Java noob question: what /type/ of Java would I need? I see there are
applets, servlets, beans and swing components... oh and Javascript
thrown in to the equation. I don't know where to begin!

I notice that IE warns about the security of some embedded components
but not others. Anyone know what makes the difference?

Is there any existing code that will do the 2-d graphing, as above,
that I could modify? Is there an existing package that will do all of
what I want? It seems a pretty basic requirement.
If you want to use Java, then I would suggest:
* JSP page with IMG tag that refers to a servlet
* the servlet gets the data from the database and
outputs the graphics (I can recommend JFreeChart
for the purpose)

Arne

Jan 29 '07 #4
James Harris wrote:
I guess keeping the database with the web server would allow just two
tiers and thus keep it simpler.
Most people would still call it 3 tier, because
it could potentially be on 3 boxes.

Arne
Jan 29 '07 #5
Lew
Arne Vajhøj wrote:
If you want to use Java, then I would suggest:
* JSP page with IMG tag that refers to a servlet
* the servlet gets the data from the database and
outputs the graphics (I can recommend JFreeChart
for the purpose)
To elaborate on that excellent suggestion:

A servlet that simply streams the bytes out from an image to the response
OutputStream can act as a URL for <image src="" ...>. For more better finer
you add mime type headers, etc., to the servlet's output.

After perusing <http://www.jfree.org/jfreechart/index.htmlI see that
JFreeChart has done this for us.

-Lew
Jan 29 '07 #6
On Sun, 28 Jan 2007 20:57:37 -0500, "-Lost"
<sp************ ****@REMOVEMEco mcast.netwrote:
>Also, avoid multiposting. It is lazy (and rude?) and people would respond to you thusly
I believe the OP crossposted, which is the preferred way. Multiposting
would involve separate posts to multiple groups and defeats the
crossposting filters available in today's newsreaders. IMO, it's
neither lazy, or rude. I choose not to do either as a general rule and
wait for a reply in one group before moving to another group. This
reply has been posted only to the group I am reading at the time.

--
Zilbandy
Jan 29 '07 #7


On 29 Jan, 06:07, "Andrew Thompson" <andrewtho...@g mail.comwrote:
....
Arne and Lew pointed out the path of JFreeChart and
servlets to produce a web-application that does what
you need, without *any* plug-ins on the client side.

Another path to take is JFreeChart combined with either
applets or a web-start applet/application, as mentioned
by Daniel.
JFreeChart looks good, even at the price(!)
Of the two (web page applet/web-start app.), you will have
far fewer problems with the latter.
Would there need to be something running on the client to report to
the user the X-value of the mouse pointer. Would that need an applet
or would that be a Javascript function... or would either do? Still
confused... can you tell? I now understand there is no connection
between Java and Javascript (other than a heritage from C) so maybe
either would do.

In my mind there would be an Applet running on the PC (within the
browser) using JDBC to read the database on the webserver. It would
connect under a userid that had read-rights only. If I have to write a
server component also (a servlet?) doesn't that make things more
complex rather than simpler?
The first route requires a Java enabled site, whereas
the second requires the end-user to have a suitbale
Java Plug-In installed.
I thought there was a JVM (is this the same as the Java plug-in you
mention) included with IE, Firefox etc? Or is it that each browser
will interpret Javascript? I'm honestly finding it difficult to work
out how these things hang together so bear with me, and many thanks
for the help.
Jan 29 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2349
by: Michael T. Peterson | last post by:
Would anyone care to recommend a good graphing package (commercial or otherwise)? I've looked at some of the PEAR Image packages - The only graphing package is still alpha quality. One particularly interesting feature would be to display data as in a 'strip chart' recorder, i.e., the graph scrolls across the web page. Any suggestions/pointers would be much appreciated. Michael
22
14354
by: Kenneth Miller | last post by:
Hello All, I am new to Python and i was wondering what graphing utlities would be available to me. I have already tried BLT and after weeks of unsuccesful installs i'd like to find something else. Anything someone would recommend? Regards, Ken
6
1596
by: Michael Hill | last post by:
Hello, all. I am considering writing an online graphing utility. I plan it to be of good quality, such that an undergraduate university student can print it out and include it with a lab report. Data points will be entered, having been generated by another program; the utility will NOT accept functions for plotting--just the data points. As far as I know, Javascript does not provide graphing functionality.
1
1169
by: Mudcat | last post by:
Hi, I have looked through the previous suggestions on graphing modules and have been able to find some good suggestions. However I was wondering about something more specific. I am going to write a program that tracks stock prices and other financial related charts, so I need to use the classic stock chart. From the ones I've seen, the graphing modules deal mostly with scientific plotting and do not have the "high/low" type charts.
2
2060
by: DeanL | last post by:
Hi everyone, I'm trying to produce a report in Access 97 that shows the difference between 2 sets of 2 fields (Estimated Cost against Actual Cost and then Estimated Working Days against Actual Working Days). My problem is that the chart wizard in Access 97 only seems to be able to operate with an aggregate function (SUM, COUNT, etc.) as one of the axis. Is there a way I can display something like a line chart the shows where each of...
1
2974
by: robby.walker | last post by:
Hi, I've just released a full-featured online graphing calculator at http://www.e-tutor.com/et2/graphing/ It requires no downloads or plugins - just JavaScript. You can track points on the curve, graph multiple functions, and more. A lot of this functionality is implemented in JavaScript. I'm very interested in hearing people's feature requests.
12
1928
by: ra294 | last post by:
I am working with ASP.net 2.0. I would like to create very simple charts on my site. Is there a solution for that in ASP.net 2.0 ? If not, can someone recommand a simple 3rd party tool ? Thanks ra294
0
1351
by: Dexter | last post by:
GraphEasyRect was previously available as an applet. Now we have converted it to a desktop standalone application that runs on multiple platforms Windows, Mac, and Linux This tool allows graphing functions in cartesian plane, points of discontinuity having limits are encircled on graph line. You may view and copy the values of the function between a range of x values
2
2185
by: sydneytroz | last post by:
I am writing a program to simulate a double displacement reaction getting to equilibrium, but I am having some trouble graphing the particles' concentrations. It seems that it's only possible to pan and zoom the graph once the program exits (when running it from IDLE), but I don't want to have to kill the sim every time I want to view the graph (besides, when I do, the graph window dissappears). The following code contains all the graphing...
0
8944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8773
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9445
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6733
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3259
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.