• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Line chart

 
Stefan Krompass
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Stefan Krompass
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic