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



Home Answers Viewqa JSP-Servlet How to create bar chart using database values
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Naveen
How to create bar chart using database values
1 Answer(s)      2 years ago
Posted in : JSP-Servlet


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 in a graph format.


Advertisement
View Answers

November 5, 2012 at 3:01 PM


Here is a jsp code that create bar chart using database values.

<%@ 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 .createBarChart3D(
"Test", 
"Id", 
"Score", 
dataset, 
PlotOrientation.VERTICAL,true, true, false);
try
{
ChartUtilities.saveChartAsJPEG(new File("C:/chart.jpg"), chart, 400, 300);
}
catch (IOException e)
{
System.out.println("Problem in creating chart.");
}
%>


Related Tutorials/Questions & Answers:
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
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... createBarChart3D() of the class ChartFactory creates a vertical 3D bar chart. Now
Advertisements
how to create bar chart in jsp using msaccess database
how to create bar chart in jsp using msaccess database  type Exception report message description The server encountered an internal error... Foundation\Tomcat 5.0\work\Catalina\localhost\chetana\org\apache\jsp\bar_jsp.java
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  thanks for reply... ChartFrame("Bar Chart",chart); frame1.setVisible(true); frame1.setSize(350,450); %>...;jspService(bar_jsp.java:80) org.apache.jasper.runtime.HttpJspBase.service
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  type Exception report message description The server encountered an internal error... Foundation\Tomcat 5.0\work\Catalina\localhost\chetana\org\apache\jsp\bar_jsp.java:57
Create Pie Chart using database values
Create Pie Chart using database values Java provides JFreeChart library which... 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 a bar chart in JSP page using JFreeChart
Create a bar chart in JSP page using JFreeChart       This Example shows you how to create a bar chart in JSP page using JFreeChart. Code given below creates a bar chart
Stacked Bar Chart Example using JFreeChart
to create stacked bar chart for given values. It  takes title, domain axis... Stacked Bar Chart Example using JFreeChart... a Stacked bar chart using JFreeChart. Bar chart will represent scores of two team
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
Stacked Bar Chart using JFreeChart
. createStackedBarChart(): This method is used to create stacked bar chart for given values... Stacked Bar Chart using JFreeChart   ... bar chart using JFreeChart. In the code given below we have extended class
bar chart
bar chart  how to create a bar chart from values of the database and the string value should be the entities of the database??plzz help..needed badly
Stacked 3d Bar Chart Example using JFreeChart
is used to create stacked bar chart for given values. It takes title, domain... Stacked 3d Bar Chart Example using JFreeChart... a Stacked 3d bar chart using JFreeChart. Bar chart will represent the score
Create a 3D bar chart in JSP page using JFreeChart
Create a 3D bar chart in JSP page using JFreeChart       This Example shows you how to create a 3D bar chart in jsp page using JFreeChart. Code given below creates a bar
How to create an area chart using jfreecharts?
How to create an area chart using jfreecharts?  i want to create an area chart that represents ip addresses of top countries. i have gone thru the area chart example using jfreechart but i am still not clear with its method. If u
Create a polar chart using JFreeChart
(): This method is used to create bar chart for given values. It takes title, dataset... Create a polar chart using JFreeChart       This Example shows you how to create
Horizontal Bar Chart Example using JFreeChart
. createBarChart():  This method is used to create bar chart for given values... Horizontal Bar Chart Example using JFreeChart... a Horizontal bar chart using JFreeChart. This example showing you match
Bar Chart using JSP and tooltip to be implemented
Bar Chart using JSP and tooltip to be implemented  Hi Deepak, I have generated a bar chart in JSP using JFreeCharts but I could not get the tool tip for that. Please any one suggest me how to do that or provide some code. Help
Stacked Bar Chart
Stacked Bar Chart  How to display a stacked bar chart using java from the values stored in the ms access database?Plzz help..its urgent
Create a pie chart in jsp page using JFreeChart
is used to create bar chart for given values. It takes title, category axis label... Create a pie chart in jsp page using JFreeChart... to create a pie chart in jsp page using JFreeChart. Code given below creates
Create Line Graph using database values
Create Line Graph using database values JFreeChart library has made.... It also provides a way to create a chart with the values that has been retrieved from the database. In this section, you will learn how to create a x-y line
JFreechart Stacked Bar Chart
JFreechart Stacked Bar Chart JFreechart provides a way to create various charts by just using the methods of different classes. You are well aware of bar chart, pie chart, line chart,area chart etc. Here we are going to create a Stacked
Bar chart implementation in PHP
Bar chart implementation in PHP  How to implements reports in bar graphs by using PHP
how to generate a bar chart on a JSP PAGE using the arraylist object passed form the servlet.(using jfreechart)
how to generate a bar chart on a JSP PAGE using the arraylist object passed form the servlet.(using jfreechart)  I have created a servlet.In this,i have retrieved a record from MS Access database in an arraylist i.e. my arraylist
Bar Chart
; In this section we are providing you an example to create a Bar Chart... for a Bar chart we have to create an object of DefaultCategoryDataset type...); After added the data in dataset we create the Bar chart by invoking
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
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
Bar Chart
multiple bar on one value means I want to create a graph where on my x-axis i have... is clear to u. Can u tel me how to create this type of graph ? plz help...Bar Chart  hi...... Thanks 4 ur help for the bar graph creation i
Bar Chart
Bar Chart       This section illustrates you how to create bar chart using html in jsp. To draw a bar chart, we have used html tags. In this, firstly
3D Bar Chart
; In this section we are providing you an example to create a 3D Bar Chart... a dataset for a Bar chart we have to create an object of DefaultCategoryDataset..., false); After added the data in dataset we create the 3D Bar chart by invoking
Create a Pie Chart in jsp Page using JFree Chart
Create a Pie Chart in jsp Page using JFree Chart  Hello Sir I followed ur tutorial on "CREATE A PIE CHART IN JSP PAGE USING JFREE CHART... the pie chart report and after that save it to the desired location.Kindly help me
 

 

 

DMCA.com