• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Bar graph using database items

 
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to convert my database figures into a bar graph. I am thinking of using Apache POI or Jcommon. Which one willl be helpful? The database will be oracle 10g and Netbeans IDE.
I am a newbie. So can anyone provide me with a sample code, it'll be very helpful. It'll be a stand alone application.
 
lowercase baba
Posts: 13073
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Noopur Kore wrote:I am a newbie. So can anyone provide me with a sample code, it'll be very helpful.


It might be helpful, but it won't happen here. We will help you figure it out, but our philosophy is that you will learn more by doing it yourself.

So...Where exactly are you stuck? Building a bar graph is an independent problem from getting data from a database. These two pieces should be completely separate from each other.
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Making a bar graph is the problem.. I can get the data from database..
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JFreeChart can do that, as will the cewolf library (see my signature) if this is a web app. If you search the web you'll find many introductory articles regarding JFreeChart. For cewolf, there's an example web app on SourceForge that should help a lot.
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't ever imported libraries which i can do if I try. And I have also not worked on graphical objects. A sample code on horizontal or vertical bar graph will be helpful so I can ask my further queries too. And What about Apache POI?? It won't work?
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you look at the Apache POI web site you will see what it does (and does not) do.

If you have never worked with external libraries then you'll have to go through a bit of a learning curve on such topics as the classpath. You will need to learn that anyway - the earlier, the better. The Oracle Java Tutorial has an extensive section on that.

You haven't told us what kind of application this is -desktop? web app?- so it's hard to point you in the right direction. Here's an example for a desktop app: https://coderanch.com/how-to/java/JFreeChartDemo
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It wont be a web app. A desktop app. I learnt importing external libraries. I just now need a to know how to implement them. Thank you.
And about the demo code, it will plots points, right? What should I do if I want a bar graph?
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What should I do if I want a bar graph?


Consult the JFreeChart javadocs to see which ChartFactory.create... method is appropriate for that.
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please a sample code!!
 
Marshal
Posts: 76447
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Noopur Kore wrote:please a sample code!!

Please read this post.

Do we have a going round in circles smilie? It would be useful for this thread.
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You already have sample code that shows how to use JFreeChart in a desktop app. If looking up the API documentation is too much hassle for you to go through for your own work, it's certainly too much hassle for us to go through for your work.
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thats ok. thanks.
 
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic