line chart from database in jsp

line chart from database in jsp

how can i create line chart from database in jsp code

View Answers

November 12, 2011 at 2:48 PM

<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="org.jfree.chart.ChartFactory" %>
<%@ page import="org.jfree.chart.ChartUtilities" %>
<%@ page import="org.jfree.chart.JFreeChart" %>
<%@ page import="org.jfree.chart.plot.PlotOrientation"%>
<%@ page import="org.jfree.data.*" %>
<%@ page import="org.jfree.data.jdbc.JDBCCategoryDataset"%>

<%
String query="SELECT * from chart";
JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:mysql://localhost:3306/chart",
"com.mysql.jdbc.Driver","root","root");

dataset.executeQuery( query);
JFreeChart chart = ChartFactory.createLineChart("Test", "Id", "Score",
                                dataset, PlotOrientation.VERTICAL, true, true, false);
                ChartPanel chartPanel = new ChartPanel(chart);
                chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
                ApplicationFrame f = new ApplicationFrame("Chart");
                f.setContentPane(chartPanel);
                f.pack();
                f.setVisible(true);

try
{
ChartUtilities.saveChartAsJPEG(new File("C:/chart.jpg"), chart, 400, 300);
}
catch (IOException e)
{
System.out.println("Problem in creating chart.");
}
%>

April 2, 2012 at 11:22 AM

I am getting chartpanel cannot be resolved to a type and applicationframe cannot be reolved to a type....... please help me..i am creating a linechart for my tradingg website project..email:[email protected]









Related Tutorials/Questions & Answers:
line chart from database in jsp
line chart from database in jsp  how can i create line chart from database in jsp code
design chart takes data from database and through jsp page
design chart takes data from database and through jsp page  how can I design chart takes data from database and through in jsp page
Advertisements
JFreechart multi line chart help in JSP
JFreechart multi line chart help in JSP  Hi, I am am looking for and help in getting multi line chart with Jfree chart, i had manage to write a singe line chart but i need multy line can you please help. <%@page
how to fetch data from mysql database table and draw a bar chart on that data using in jsp
how to fetch data from mysql database table and draw a bar chart on that data using in jsp  how to create bar chart fetch data from mysql database using in jsp.please give me a right code. yhanks in advance
connect to the database from JSP
connect to the database from JSP  How do you connect to the database from JSP?   A Connection to a database can be established from a jsp page by writing the code to establish a connection using a jsp scriptlets
While retrieving text from database onto JSP, the alignment of line and paragraphs is not followed
While retrieving text from database onto JSP, the alignment of line and paragraphs is not followed  I have stored text database through textarea box. While trying to retrieve the same text from db, the text displayed onto
jfreechart displaying chart from access database
jfreechart displaying chart from access database  I have these 2 codes. array.java----in which i retrieve the values from the database . import... and then the chart should be displayed on a jsp..how can i do it..pls reply..its
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  type Exception... to compile class for JSP An error occurred at line: 8 in the jsp file: /bar.jsp... = window.adsbygoogle || []).push({}); An error occurred at line: 8 in the jsp
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... customer come to me. in this chart have two values nm_id and date. Please give
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  thanks for reply...="org.jfree.data.jdbc.JDBCCategoryDataset"%> <% String query="SELECT * from chart... description The server encountered an internal error () that prevented it from
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  how to send data from mysql database to google chart api using java
display combination of a stacked area chart and line chart in one iframe using jfree - JSP-Servlet
display combination of a stacked area chart and line chart in one iframe using jfree  hello i have a problem related to jfree chart, i want to display combination of a stacked area chart and line chart in one iframe
Repairing mysql database from command line
Repairing mysql database from command line  Hi, Can anyone tell me the process for repairing mysql database from command line? Thanks
Update Database from jsp
Update Database from jsp   I want to update my oracle database column from a text box ,so whenever I input some text value in the text box and click UPDATE button the database field should be updated . I have a drop down menu
How to access the database from JSP?
How to access the database from JSP?  Hi, What is the process of accessing the database from JSP page? Thanks   Hi, In the JSP program... database from JSP which explains you how to access the database by embedding
display date to jsp from database
display date to jsp from database   display date to jsp from database to calender if the start date and end date is available than calender date... not available in database field than show in green color and clickable. NOTE :- Date
how to create a bar chart in jsp by fetching value from oracle databse?
how to create a bar chart in jsp by fetching value from oracle databse?  i want to show the population of various states in a bar chart in my jsp page by fetching the data from my oracle table. i am using my eclipse as my IDE
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  Добовляйтесь в группу "МАЙНКРАФТА" Будьте участниками Группы Помогаите нам и себе Наша группа https://vk.com/club60851464 Есть свой сервер! Хорошая атмосфера
how to create bar chart in jsp using msaccess database
how to create bar chart in jsp using msaccess database  type...: Unable to compile class for JSP An error occurred at line: 10 in the jsp file... = window.adsbygoogle || []).push({}); An error occurred at line: 10 in the jsp file
Connecting to Database from a hyperlink in JSP - JSP-Servlet
Connecting to Database from a hyperlink in JSP  How can I connect to database by clicking on a hyperlink in a JSP Page.Can you please give me sample... which is connect to database using jdbc database
code for insert the value from jsp to access database
code for insert the value from jsp to access database  code for insert the value from jsp to access database
search functionality using jsp from database
search functionality using jsp from database  search functionality using jsp from database
how to display data from database in jsp
how to display data from database in jsp  how to display data from database in jsp
data are not display in JSP from database - JSP-Servlet
data are not display in JSP from database   i want to finding some data through a SQL query from SQL server database to a JSP page based on some... of this jsp page. like.. School Result and three request parameters 'class', 'from
Loading a jsp page (with record from database) from another jsp page
Loading a jsp page (with record from database) from another jsp page  Suppose I have two jsp pages Search.jsp and Getdata.jsp. There are two fields... with records from database(against Serial no and year).That is, as soon
3 dropdown list from the database using JSP
3 dropdown list from the database using JSP  Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP
How to retrieve image from mysql database in JSP?
How to retrieve image from mysql database in JSP?  Hi, I need JSP... to retrieve image from mysql database in JSP? Thanks   Hi, You can write... images from Database in JSP. Thanks
java line chart
java line chart  Hi, I want to draw a graphic in java line chart and ? searched the documents ?n the web. I found the example codes ?n your site (http://www.roseindia.net/chartgraphs/xyline-chart.shtml) and tr?ed ?n my
How to retrieve blob image from database in JSP?
How to retrieve blob image from database in JSP?  Hello, JSP is used... the blog image from database. How to retrieve blob image from database in JSP?   Hi, Please check the tutorial Retrieve image from database using
How to store and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one... and retrieve image from database in JSP? Thanks   HI, You can use... the image. Check this example: Retrieve image from database using Servlet. Thanks
Pie chart on jsp
Pie chart on jsp  how can i create a pie chart on a jsp page using jfreechart which takes values from my databaase??   Here is a jsp code that creates a pie chart using JFreechart api and takes the value from
getting values from database - JSP-Servlet
JSP code separately.If it will not display database values then try your code...getting values from database  I tried the following code abc.html aaa.jsp I am not getting exceptions now
Retrieve database from the table dynamically in jsp from oracle using servlet
Retrieve database from the table dynamically in jsp from oracle using servlet  Sir, I have created a table in oracle using eclipse, and added few... using java servlet from the database in the jsp page
autocompletion in textfield fetching from database in jsp
autocompletion in textfield fetching from database in jsp  hi i want to retrieve country name from mysql db to textfield.. maeans if anyone type... i caant able to select particular name to textfield... it should be in jsp
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity with database from my web site. In my local host-- when I am typing
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity with database from my web site. In my local host-- when I am typing following code
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity with database from my web site. In my local host-- when I am typing following code
select value from autocomplete textbox using jquery in jsp from database.
select value from autocomplete textbox using jquery in jsp from database.  Hii Sir, Lots of thnx to ur reply .I went through both... of selecting value from autocomplete textbox using jquery in jsp from mysql database
select value from autocomplete textbox using jquery in jsp from database.
select value from autocomplete textbox using jquery in jsp from database. ... but was unable to find out exact way to fullfill the solution of selecting value from autocomplete textbox using jquery in jsp from mysql database. Kindly send me
Display Data from Database in JSP
, to show data from the database click on the link that calls another .jsp file named...;/head> <body> <h2>Data from the table 'stu_info' of database... dirctory of welcome_to_database_query.jsp. Click on the link given in the first jsp
how to get data from database into dropdownlist in jsp
tutorial go through the link JSP Get Data Into Dropdown list From Database   ...how to get data from database into dropdownlist in jsp  Can anybody... the database and set it into dropdown list in jsp please help <br/>
Fetching database field from servlet to jsp page ?
Fetching database field from servlet to jsp page ?  Hello Java... field. I wanted to pass some of the database field from servlet to jsp... (i am opening my database in servlet init() method ) how to pass rs.getString(8
JSP to add details to a database from a HTML form.
JSP to add details to a database from a HTML form.  Hi I'm a second year CS student who has to use JSP to validate a HTML form and add the details entered into a database. The files are all in one folder for use in tomcat
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. <
Create Pie Chart using database values
bar charts, line charts in the previous sections. Here we are going to create a pie chart by retrieving the values from the database. Here is the code...Create Pie Chart using database values Java provides JFreeChart library which
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... from MySQL database and then using the jfree chart library to create chart
displaying data retrieved from a database in a jsp page
displaying data retrieved from a database in a jsp page  the page should display username, emailid, telephone in addition to tthe tagline however... sql = "select billid, customerid, billdate, status from customerbills where
how to display data from jsp file into database
how to display data from jsp file into database  this is a jsp file . look at the line with code-> Statement st=con.createStatement(); in the below example. the error is "cannot convert from java.sql.Statement
data retrival from database throw simple jsp..
data retrival from database throw simple jsp..  We can retrieve the the data from data base simple jsp page: Jsp Page:retrive.jsp <...; Statement stmt = null; String Query="SELECT * FROM STUD"; try
how to retrieve images from database to jsp?
how to retrieve images from database to jsp?  Hi sir,i want to stores images along with the name and price with database and retrieve it on jsp.and...=con.createStatement(); String strQuery = "select * from data"; ResultSet rs

Ads