• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create charts...  RSS feed

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Could you kindly tell me how to create charts(pei charts, bar charts, line charts etc.). I am sure it is possible to do it.
step by step advice is much appriciated. Is there a place where I can refer notes on it.
thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there are two possible approaches: one would be to subclass JPanel to create your own "Chart" component. In that Chart component, you'd override paintComponent(), and in paintComponent() you'd draw a chart, one little symbol or tic-mark at a time. It's lots of work, and you need to be pretty good at geometry!
The other way would be to buy a charting component written by someone else -- or perhaps find a free one. I found this decent-looking one in about 1/3 second of Googling:
http://www.jfree.org/jfreechart/index.html .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!