• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to create graphs using data from database.  RSS feed

 
ashok movva
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a project in which I need to create graphs from the data that is stored in tables in MySQL database.

can anyone suggest me how to do it in java language.

Thanks in advance.
 
Campbell Ritchie
Marshal
Posts: 56534
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How far have you got?
 
ashok movva
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not start, I am looking for how to start it
 
Fred Kleinschmidt
Bartender
Posts: 571
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The term "graph" can have several meanings.
First, there is a data structure called a graph, which is a way of showing connections of data nodes.
A graph can also mean an X-Y plot. or a 3-D plot.

They are two completely different things. So you need to explain what you want to do.
 
ashok movva
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
table in database has two columns 1.device and 2. power usage

I need to generate a x-y plot for the data in the above table

x-->Device

y-->power usage

help me to draw bar graphs from above data
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66305
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Draw on what? A terminal screen? Swing GUI? Web page? Something else?
 
ashok movva
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bar graphs on a web page
 
Richard Hayward
Ranch Hand
Posts: 187
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ashok movva wrote:draw bar graphs from above data


Would a command line response something like this do?

Light:                    *
Toaster:                ****
Washing machine:  ***********************

(Looks more like a bar chart at the command line with a fixed width font)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66305
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Hayward wrote:Would a command line response something like this do?

Not suitable for use on a web page.
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard Hayward wrote:(Looks more like a bar chart at the command line with a fixed width font)

You can get a fixed font by surrounding your text with a [code=text] tag, or select "Text" from the dropdown next to the Code button.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66305
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ashok movva wrote:Bar graphs on a web page

That's obviously an important detail. Be sure to include this type of information up-front in future posts.

For graphing on a web page it's best to use a JavaScript charting library such as HighCharts. Your backend return the data as JSON for consumption by the front end JavaScript code.

 
Richard Hayward
Ranch Hand
Posts: 187
11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Richard Hayward wrote:Would a command line response something like this do?

Not suitable for use on a web page.


Yep, I saw your question & ashok's reply after hitting the submit button.
Seems there's no way to delete a post however, once submitted.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!