Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Interview-Questions line chart from database in jsp
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


aml yakout
line chart from database in jsp
2 Answer(s)      3 years ago
Posted in : JSP-Interview Questions


how can i create line chart from database in jsp code


Advertisement
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:giri7891@gmail.com



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
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
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
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
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
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  type Exception... org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 8 in the jsp... occurred at line: 8 in the jsp file: /bar.jsp Generated servlet error
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
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
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  thanks for reply...="SELECT * from chart"; JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:odbc... description The server encountered an internal error () that prevented it from
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
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... org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 10... at line: 10 in the jsp file: /bar.jsp Generated servlet error
hybrid chart(Stacked Area and Line ) - Swing AWT
hybrid chart(Stacked Area and Line )  hello i have a problem... different chart stacked area chart and line chart both in a single frame. That is hybrid combination of stacked areachart and line chart in one frame. I want
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
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
Making XY line chart with string and double axis
Making XY line chart with string and double axis  Good evening everybody So i'm trying to make a XYLine chart with JFreechart. The data comes from 2 arraylist, so a for-loop should do the trick parsing the values
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
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...(String[] args) throws Exception { String query = "SELECT * from chart
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
Create Line Graph using database values
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...Create Line Graph using database values JFreeChart library has made
create chart - JSP-Servlet
.jrxml report. I want to create a chart using ireport software. I m using sql 10g as my database. The table consist of columns like employee_id feature_id(primary key) title status I want to show chart of field "date" only
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 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
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
Line From code
Line From code  document.getElementById("demo").innerHTML=Date(); Please explain each and every word in this line
Bar Chart in JSP - JSP-Servlet
Bar Chart in JSP  Hi I am creating Bar chart using Jfree charts in JSP. Please advise me how to customize it. Like controlling the colors, width for each bar, showing values above the bar .  hi friend, Use
how to display data from database in jsp
how to display data from database in jsp  how to display data from database in jsp
search functionality using jsp from database
search functionality using jsp from database  search functionality using jsp from database
 

 

 

DMCA.com