Home Answers Viewqa JDBC How to show database values in Graph.(Like Cricket score board Graph)

 
 


Praveen Chinthala
How to show database values in Graph.(Like Cricket score board Graph)
3 Answer(s)      a year and 4 months ago
Posted in : JDBC

Hi, Can Any one help out! How to show database values in Graph. i mean while changing values in database,the corresponding curve should change accordingly.(Like Cricket score board Graph)

View Answers

January 16, 2012 at 4:00 PM


import java.sql.*;
import org.jfree.chart.*;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.xy.*;
import org.jfree.data.*;

public class Chart{
public static void main(String arg[])throws Exception{
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root" );
        Statement st=conn.createStatement();
        ResultSet rs=st.executeQuery("SELECT * from cricket_match");
  XYSeries series = new XYSeries("");
  while(rs.next()){

  series.add((double)rs.getInt("runs"),(double)rs.getInt("overs"));
  }
  XYDataset xyDataset = new XYSeriesCollection(series);
  JFreeChart chart = ChartFactory.createXYLineChart
  ("Match Score", "Runs", "Overs",
 xyDataset, PlotOrientation.VERTICAL, true, true, false);
  ChartFrame frame1=new ChartFrame("",chart);
  frame1.setVisible(true);
  frame1.setSize(300,300);
  }
}

January 17, 2012 at 10:54 AM


Hello Deepak, I am New To Jfreechart....i dnt knw how to compile jfree programs? Please suggest me...

Thanks & regards, Praveen


January 17, 2012 at 3:21 PM


kk i got the idea about jfree...but how thw j frame window will auto refresh.









Related Pages:
How to show database values in Graph.(Like Cricket score board Graph)
How to show database values in Graph.(Like Cricket score board Graph)  Hi, Can Any one help out! How to show database values in Graph. i mean while....(Like Cricket score board Graph)   import java.sql.*; import
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
to show graph
to show graph  by clicking on submit button how to show the graph by fetching data in mysql?   Please visit the following link: JSP graph by fetching data in mysql
Create Line Graph using database values
Create Line Graph using database values JFreeChart library has made... retrieved from the database. In this section, you will learn how to create a x-y line graph by retrieving the values from the database. Here is the code: import
graph generation using jfreechart and retrieving values from the database
graph generation using jfreechart and retrieving values from the database ... database using prepared statement and then display the bar graph using..... Note that it is a access made database. How can I proceed ..Pls answer.Its very
make chart or graph from database - Java Beginners
make chart or graph from database  d, I want to ask about how to make a chart or graph. First i have Table name= "customer" and field =(cust_id,nm_id,date_cust) I want to view in date,know who's to my customer and how many
datewise/monthwise bar graph
datewise/monthwise bar graph  How to make a datewise/monthwise bar graph using the values from the ms access database? please help its urgent
statistical graph in jsp - JSP-Servlet
statistical graph in jsp  how to create a statistical graph to show... fields id, and score is there any way to have the id's and the scores represented by a graph without hard coding the id's and the scores
How to create bar chart using database values
How to create bar chart using database values  How to create bar chart using database values i.e excellent,good,average fields using jsp?It is like opinion poll.I want to show how many votes are came for excellent,good,average
draw the running or moving graph using database in jsp
draw the running or moving graph using database in jsp  hi my question is how to draw the running or moving graph using jsp and take x and y co-ordinate value from database
draw the running or moving graph using database in jsp
draw the running or moving graph using database in jsp  hi my question is how to draw the running or moving graph using jsp and take x and y co-ordinate value from database
Create Bar graph
Create Bar graph  hi............. In my project i want to create a BAR GRAPH to display the result. I HAVE certain values that want to show in graph... i can edit the code and put my values... i have seen some codes which
line graph
line graph  I have developed an application and in that i have to compare 2 reports using line graph from the data taken from ms access database?please help
Applet Graph
of information(column names) from database(mysql) 2..i have to select any two columns-names by using check box and click on graph button, 3..then i have to get a graph between those columns in a applet plz send me the code thank u
Autoupdating graph
Autoupdating graph  Hey Anyone who might help me making a XY graph, that autoupdates lets say every 5th minute. All the datasets comes from an mySQL database, and the dataset in the database, comes from a txt file and are being
java-graph help - Java Beginners
java-graph help  sir/madam I wanted to design a shortest path Algorithm. i wanted to show the shortest path in graphical format in the way it looks... drawstring,but i dono how to print the variable value.pls help me
Bar graph
Bar graph  How to include a bar chart in iPhone sdk
Draw graph using jsp without database connection
Draw graph using jsp without database connection  Draw graph using jsp code without database connection
Graph in JAVA SWING
Graph in JAVA SWING  Hi, How to draw a simple GRAPH in JAVA SWING ?  ..., Please visit the following link: Bar Graph in Java Swing Thanks
How to show data from database in textbox in jsp
How to show data from database in textbox in jsp   How to show data from database in textbox in jsp   Here is an example that retrieve the particular record from the database and display it in textbox using JSP. <
how to write the coding for converting the database data for example population into any type of graph using jsp and servlets?//
coding for converting the database data  how to write the coding for converting the database data for example population into any type of graph using... the database data for example population into any type of graph using jsp and servlet
show the database values graphical represantation
show the database values graphical represantation   show the database values graphical represantation and auto refresh for every 30 secand displaying in webpage
about graph - Applet
about graph  How to draw a graph in applet and that should be display in web browser? How to make a running applet in our browser? for example ticker
To display the bar graph
To display the bar graph  hi........ I am able to get the output of bar graph. but now i want that to be displayed on my own form. The code which i... form that i have created. Can u tell me how to do this??????? Plz help
radar graph in java
radar graph in java  Hi All I am developing a java application. In this application i need to show a radar grap.when some body assigne rating then each rating should show on x y z axis. please suggest me some good way to do
How to show autocomplete textbox values on combo box option selection using database?
How to show autocomplete textbox values on combo box option selection using database?  When I select option(i.e First Year) then it will show list of student names in auto-complete text box
how to show data in database ?
how to show data in database ?  how to show the data in the database to the user in the textbox so that user can modify it and save it again
How to export chart(graph) generated by jsp into a excel?
How to export chart(graph) generated by jsp into a excel?  How to export chart(graph) generated by jsp into a excel? I have a jsp page which generates charts . Now I need those charts to be exported into an excel.please help
coding for eletric signal graph
coding for eletric signal graph  How can I draw an electric signal from Manchester and Differential Manchester coding from binary bits that converted from a character for example character
Show results in HTML
Show results in HTML  Hi. I have a field in database named stages... they are separated by comma. I want to take the values as single values like chennai as one value, trichy as one value. and i have to show it in html. how to do
PHP GD line graph
as $values){ $cx = $tx + 30; $cy = 200-$values; imageline($im,$tx,$ty,$cx...,'Line Graph by: Roseindia Technologies',$red); imagepng($im); ?> After
An Applet program for Drawing picture & graph - Applet
An Applet program for Drawing picture & graph  How can I write an Applet program for drawing picture and graph having various colours and tools provided
Representing Graph using adjacency list & perform DFS & BFS
Description: This tutorial demonstrate how to create a graph using adjacency list and perform DFS and BFS. Different kind of graph are listed below: Directed Graph: A directed graph is one in which edges connect nodes in only one
Database values in JComboBox
Database values in JComboBox In this section, you will learn how to display values in JComboBox from database. For this, we have allowed the user to enter... the database will get displayed on the ComboBox. If there will be  no data
how to show value and percentage in piechart sections from database using jfreechart
how to show value and percentage in piechart sections from database using jfreechart  Hii Sir, I made a pie chart from database using jfreechart.Now I need to display the values and their percentage in the sections
How to show the maximum and the minimum in array...
How to show the maximum and the minimum in array...  I have a bookstore application, but I cannot show the maximum and the minimum price of the book... to SAJID's Book Shop"); System.out.print("How many book would you like to store
How to show the maximum and the minimum in array...
How to show the maximum and the minimum in array...  I have a bookstore application, but I cannot show the maximum and the minimum price of the book... to SAJID's Book Shop"); System.out.print("How many book would you like to store
reading data from excel file and plotting graph
at the same time from one excel file using different columns..how can i do that? waiting for reply   and also help me how can i get date and time value from excel to plot on an axis in graph
Read Excel file and generate bar graph
Read Excel file and generate bar graph In this tutorial, you will learn how to read an excel file and generate bar graph. Here is an example that reads an excel file using POI api and store the data into array list. We have created
retrieve record from table and show it in HTML
as single values like chennai as one value, trichy as one value. and i have to show...retrieve record from table and show it in HTML  Hi. I have a field in database named stages. its datatype is varchar(60). It contains values chennai
How to draw to graph in Ms Excel from the data which is sent from an java application....?
How to draw to graph in Ms Excel from the data which is sent from an java application....?  How to draw to graph in Ms Excel from the data which is sent from an java application
Create Bar Chart with database values
Create Bar Chart with database values In this section, you will learn how to create a bar chart by retrieving the values from the database. For this purpose... the implementation over a database JDBC result set. Its constructor consists
plot a graph in Java
plot a graph in Java   I need to plot a graph in Java but the samples are not known in advance. The samples keep on coming through callback and I... and the final graph may be quite congested. So please guide me on this. Thanks
Changing 2D graph using slider.
Changing 2D graph using slider.  Code for changing a 2d graph with help of slider
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  Hello Sir, I have developed a swing application in which database table is shown... ,update,delete database values from jtable only so i added three buttons add,update
How to insert and update all column values of database from jtable.
How to insert and update all column values of database from jtable.  Hello Sir, I have developed a swing application in which database table is shown... ,update,delete database values from jtable only so i added three buttons add,update
how to show x axis values of timeline chart in jfreechart with particular month.
how to show x axis values of timeline chart in jfreechart with particular month.  my x-axix timeline having day of 1 month and days shows me only differently and 1 month. I want month attached with days

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.