School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,115 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,321 people online right now. Registration is fast and FREE... Join Now!



Getting java to read data from postgresql and plot a graph

Getting java to read data from postgresql and plot a graph Rate Topic: -----

#1 andrewktmeikle  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 8
  • Joined: 28-February 08


Dream Kudos: 0

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.
Was This Post Helpful? 0
  • +
  • -


#2 1lacca  Icon User is offline

  • code.rascal
  • Icon
  • Group: Alumni
  • Posts: 3,822
  • Joined: 11-August 05


Dream Kudos: 0

Posted 28 August 2008 - 06:31 AM

Jasperreports?
Was This Post Helpful? 0
  • +
  • -

#3 JeroenFM  Icon User is offline

  • D.I.C Head
  • Icon
  • View blog
  • Group: Contributors
  • Posts: 195
  • Joined: 30-June 08


Dream Kudos: 100

Posted 28 August 2008 - 08:05 AM

View Post1lacca, 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

Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • Java Lover
  • Icon
  • Group: Mentors
  • Posts: 11,168
  • Joined: 06-March 08


Dream Kudos: 475

Posted 28 August 2008 - 02:13 PM

java.awt.graphics.drawPolyline()
Was This Post Helpful? 0
  • +
  • -

#5 andrewktmeikle  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 8
  • Joined: 28-February 08


Dream Kudos: 0

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

This post has been edited by andrewktmeikle: 09 October 2008 - 01:35 AM

Was This Post Helpful? 0
  • +
  • -

#6 andrewktmeikle  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 8
  • Joined: 28-February 08


Dream Kudos: 0

Posted 09 October 2008 - 01:19 AM

View Postpbl, 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)
Was This Post Helpful? 0
  • +
  • -

#7 JeroenFM  Icon User is offline

  • D.I.C Head
  • Icon
  • View blog
  • Group: Contributors
  • Posts: 195
  • Joined: 30-June 08


Dream Kudos: 100

Posted 09 October 2008 - 06:14 AM

View Postandrewktmeikle, 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


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.
Was This Post Helpful? 0
  • +
  • -

#8 andrewktmeikle  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 8
  • Joined: 28-February 08


Dream Kudos: 0

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 :P i do indeed wish to draw the graph of a function. So their isn't any easier, excluding a applet, that will help me draw graph, no specific swing components or anything? I just have to battle away manually draw grid lines etc?
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month