Getting java to read data from postgresql and plot a graph
Page 1 of 1
Getting java to read data from postgresql and plot a graph
#1
Posted 28 August 2008 - 06:24 AM
Hey all,
I've just finished one task and have been set another. The inital task was to read data stored in a table in postgresql. That, i've done. The second task was to, then, plot a graph from the data stored in the postgresql table.
I've been searching around online to find some source code, not an applet or a servlet and the solution seems, not non-existent, invisible to the needy.
Even though it does say in nice BOLD letter "We Will Not Do Your Homework" i'm just looking for some helpful source code sites that you programmers have been to and trust for reliability that could aid in plotting a graph from the conents of a postgresql table.
I'm a relative beginner so if the solution to the problem is simple and illudes me also make that clear.
Thanks very much.
I've just finished one task and have been set another. The inital task was to read data stored in a table in postgresql. That, i've done. The second task was to, then, plot a graph from the data stored in the postgresql table.
I've been searching around online to find some source code, not an applet or a servlet and the solution seems, not non-existent, invisible to the needy.
Even though it does say in nice BOLD letter "We Will Not Do Your Homework" i'm just looking for some helpful source code sites that you programmers have been to and trust for reliability that could aid in plotting a graph from the conents of a postgresql table.
I'm a relative beginner so if the solution to the problem is simple and illudes me also make that clear.
Thanks very much.
#3
Posted 28 August 2008 - 08:05 AM
1lacca, on 28 Aug, 2008 - 07:31 AM, said:
Jasperreports?
JasperReports uses JFreeChart. At least I'm guessing he meant a chart. If it's an actual graph (you know, Vertices and Edges) he wants, then he could try JGraph.
This post has been edited by JeroenFM: 28 August 2008 - 08:13 AM
#5
Posted 09 October 2008 - 01:10 AM
yes, i was looking for a graph with " vertices and edges" eg x and y axis.
Trouble is I can't use an external applet to do it, I was not sure if their was a specific swing component that you can draw, and accuratly place, points on a graph in relation to fixed axis. I do know about "drawLine" but I wasn't sure if there was a more accurate way of doing it.
The java tutorials on the sun site, do not deal with these issues and i'm having touble generalising their solution.
Thanks again for the help
Trouble is I can't use an external applet to do it, I was not sure if their was a specific swing component that you can draw, and accuratly place, points on a graph in relation to fixed axis. I do know about "drawLine" but I wasn't sure if there was a more accurate way of doing it.
The java tutorials on the sun site, do not deal with these issues and i'm having touble generalising their solution.
Thanks again for the help
This post has been edited by andrewktmeikle: 09 October 2008 - 01:35 AM
#6
Posted 09 October 2008 - 01:19 AM
pbl, on 28 Aug, 2008 - 03:13 PM, said:
java.awt.graphics.drawPolyline()
From what i've read since your comment, i've gathered that drawPolyline is used when you want to draw connected lines. Granted i will need to do this at a later stage but at the moment i just want to use a swing component, if there is absolutly no choice then i will use an applet, to accruate draw axes with measurements(which is what i would be creating inside a swing component of some kind) and be able to use said measurements to plot a line graph( hence i will need drawpolyline later on)
#7
Posted 09 October 2008 - 06:14 AM
andrewktmeikle, on 9 Oct, 2008 - 02:10 AM, said:
yes, i was looking for a graph with " vertices and edges" eg x and y axis.
Trouble is I can't use an external applet to do it, I was not sure if their was a specific swing component that you can draw, and accuratly place, points on a graph in relation to fixed axis. I do know about "drawLine" but I wasn't sure if there was a more accurate way of doing it.
The java tutorials on the sun site, do not deal with these issues and i'm having touble generalising their solution.
Thanks again for the help
Trouble is I can't use an external applet to do it, I was not sure if their was a specific swing component that you can draw, and accuratly place, points on a graph in relation to fixed axis. I do know about "drawLine" but I wasn't sure if there was a more accurate way of doing it.
The java tutorials on the sun site, do not deal with these issues and i'm having touble generalising their solution.
Thanks again for the help
I think you misunderstood me, I was talking about mathematical graphs: http://en.wikipedia....h_(mathematics), while I think you're talking about a http://en.wikipedia....h_of_a_function.
To do the former, uses JGraph, to do the latter, use JFreeChart. Or you can just draw on a component manually using Graphics objects.
#8
Posted 10 October 2008 - 02:03 AM
Quote
I think you misunderstood me, I was talking about mathematical graphs: http://en.wikipedia....h_(mathematics), while I think you're talking about a http://en.wikipedia....h_of_a_function.
yeah I believe i did misunderstand you
Page 1 of 1

Start a new topic
Add Reply




MultiQuote

| 


