wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Line chart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Line chart" Watch "Line chart" New topic
Author

Line chart

Stefan Krompass
Ranch Hand

Joined: Apr 29, 2004
Posts: 75
Hi,

I try to paint a simple line chart (more or less looking like a trapeze) for displaying data. Furthermore, I want to be able to alter the trapez (and therefore the underlying data), but I have no idea how to implement this... My first try was painting the lines with Graphics#drawLine(int, int, int, int) but the result is ... ugly. I already found JFreeChart, but with this, I can only display data, and not alter it. Can someone show me the way to present the data while being able to alter the line chart?
Thanks for help!

bye

Stefan
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Stefan Krompass
Ranch Hand

Joined: Apr 29, 2004
Posts: 75
Hi,

thank you for your code. I do not want to be ungrateful to you, but I cannot see the connection between the code and my original posting...

cu

Stefan
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
I gave the code to illustrate:
1 - one way to draw graphics with the data exposed for alteration by event code
2 - how to draw smooth (anti-aliased) lines
3 - a way to allow user input to alter the model information which underlies the graphics (and thus the graphics)
4 - a way to organize the code by function to keep it clear and easy to use.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Line chart
 
Similar Threads
Line graph or bar chart
needing tips for developing a line chart that takes in data points to generate chart
cewolf data points not visible
histogram plus lines
Getting the X, Y coordinate values in a JChart