Willza99
Willza99

Reputation: 1

How to Draw a Graph in Java

I'm currently trying to think of a way to plot a graph in Java.

The basic way my program is meant to work is it finds a users .csv file and in there will be some sort of habit and the date. So like drove 5 miles on 24.10.13.

So I need to be able to extract the 5 and the 24.10.13 and take those as my Y and X co-ordinates respectively as other things are measured against date and it makes sense to have that as the X value.

So is there a library I can import or a Function I'm not aware of and could you give a simple example on how to use it?

NOTE - I've done my GUI in JavaFX as I'm not that great in JFrame and I know nothing of Swing

Upvotes: 0

Views: 4907

Answers (2)

Steffen
Steffen

Reputation: 4239

JavaFX has built-in charts. You may check it out. That way, you won't need any external libraries.

Upvotes: 1

user2578094
user2578094

Reputation:

How about using JFreeChart to plot your data? You can see some samples here. JGraph seems to be geared towards visualizing graphs, not for plotting functions.

Upvotes: 1

Related Questions