• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Line chart

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Stefan Krompass
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic