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 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 Tutorials/Questions & Answers:
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
Advertisements
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
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
What is Graph Database
What is Graph Database  Hi, What is Graph Database? Thanks   Graph Database? Graph Database is special kind of database which is used... Database and then query it using the graph query. It provides API for querying
What is Graph Database
What is Graph Database  Hi, What is Graph Database? Thanks   Graph Database? Graph Database is special kind of database which is used... Database and then query it using the graph query. It provides API for querying
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
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
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
Draw graph using jsp without database connection
Draw graph using jsp without database connection  Draw graph using jsp code without database connection
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
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
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 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
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 display the database values in pdf format
how to display the database values in pdf format   in struts how to display the values in pdf format when clicking a button in jsp page   jsp code using itext api: <%@page import="java.io.*"%> <%@page import
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
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
How to store extracted values from xml in a database? - XML
How to store extracted values from xml in a database?  I want to store extracted xml values in a database... How can i store extacted xml values in a database... give me a example
How to store extracted values from xml in a database? - XML
How to store extracted values from xml in a database?  I want to store extracted xml values in a database... How can i store extacted xml values in a database... give me a example
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
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
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
how to get the values to dropdownlist from oracle database
how to get the values to dropdownlist from oracle database   </script> </head> <body> <select name='countryname' onchange="showState(this.value)"> <option value
how can i store text box values as it is in database table
how can i store text box values as it is in database table  CUSTOMER DESCRIPTION
How to make a line graph in Matplotlib?
Matplotlib Examples - How to make a line graph in Matplotlib? In this tutorial we are going to create simple line graph in Matplotlib library. You can run...;) To show the graph following code is used: plt.show() In this tutorial you learned
How to make a line graph in Matplotlib?
Matplotlib Examples - How to make a line graph in Matplotlib? In this tutorial we are going to create simple line graph in Matplotlib library. You can run... code is used: plt.xlabel('Years')ADS_TO_REPLACE_4 To show the graph
how to show image as a link which path coming from database
how to show image as a link which path coming from database   iam not getting proper answer for it. I am using netbeans .the url coming instring from database ,want to display as image on jsp . please help me
janusgraph clear graph
of graph database. Thanks... developed it is filled with all junk data. I want do clear my graph by deleting all data. How to clear JanusGraph? Thanks   Hi, Its easy
how to read values from excel sheet and compare with database using jsp
how to read values from excel sheet and compare with database using jsp  hi sir i am arun how to read values from excel sheet and compare...,serialno) values of excelsheet we have to compare with database value if these 3
how to retreive values from MS Access Database based on the values entered in textbox values in jsp file
how to retreive values from MS Access Database based on the values entered in textbox values in jsp file  Hi am new to java. i need to create... in MS Access Database. the table structure is Sno JobName ProgramName Problem
How to store values in a database using JSTL? - JSP-Servlet
How to store values in a database using JSTL?  I want to store values in a database... How can i store in database? Here is my code... This wil... in a database...How can i do? Airport
How to insert dynamic textbox values into database using Java?
How to insert dynamic textbox values into database using Java?  Hi I am trying to insert dynamic textbox values to database, my jsp form have 2... these dynamic textbox values to database(Oracle 11g)...Please help me out. I have
How to update,Delete database values from jtable cells ..
How to update,Delete database values from jtable cells ..  Hello Sir, I am working on a project in which i have to fetch the values... the database records from the table cells by entering new values there only
How to update,Delete database values from jtable cells ..
How to update,Delete database values from jtable cells ..  Hello Sir, I am working on a project in which i have to fetch the values from database to jtable .Now as per my requirement i need to update and delete the database
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 display values from database into table using jsp
how to display values from database into table using jsp  I want to display values from database into table based on condition in query, how... the values from database based on the bookname or authorname entered must be display
Line Graph using JFreeChart
Line Graph using JFreeChart  I need to draw a line graph of the (no. of sales made on y axis) by a shop with (dates on x axis) using data from MySQL database and JFreeChart
ModuleNotFoundError: No module named 'graph'
ModuleNotFoundError: No module named 'graph'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'graph' How to remove the ModuleNotFoundError: No module named 'graph'
ModuleNotFoundError: No module named 'graph'
ModuleNotFoundError: No module named 'graph'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'graph' How to remove the ModuleNotFoundError: No module named 'graph'
Version of commons-graph>commons-graph dependency
List of Version of commons-graph>commons-graph dependency
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 update,Delete database values from jtable cells ..
How to update,Delete database values from jtable cells ..  hello Sir... from database into jtable of a jpanel.. Now Sir, According to my need i have to update the cell values from there only means that whatever values i ma entering
How to extract values from SOAP Response message and insert in database
How to extract values from SOAP Response message and insert in database ... values from SOAP Response XML (i.e. Empname,EmpID,Phnumber) but I don't have any idea of XML.Also I need to update these parsed values into the database. Can you

Ads