JFree 3D Bar Chart not displaying in JSP

JFree 3D Bar Chart not displaying in JSP

View Answers

October 20, 2009 at 2:51 PM

Hi Friend,

Try the following code:

<%@ page import="java.awt.*" %>
<%@ page import="java.io.*" %>
<%@ page import="org.jfree.chart.*" %>
<%@ page import="org.jfree.chart.axis.*" %>
<%@ page import="org.jfree.chart.entity.*" %>
<%@ page import="org.jfree.chart.labels.*" %>
<%@ page import="org.jfree.chart.plot.*" %>
<%@ page import="org.jfree.chart.renderer.category.*" %>
<%@ page import="org.jfree.chart.urls.*" %>
<%@ page import="org.jfree.data.category.*" %>
<%@ page import="org.jfree.data.general.*" %>
<%
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.setValue(80,"Marks","A");
dataset.setValue(90,"Marks","B");
dataset.setValue(75,"Marks","C");
dataset.setValue(85,"Marks","D");
dataset.setValue(99,"Marks","E");
dataset.setValue(68,"Marks","F");
JFreeChart chart = ChartFactory .createBarChart3D(
"Test",
"Name",
"Marks",
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.");
}

%>

Thanks









Related Tutorials/Questions & Answers:
JFree 3D Bar Chart not displaying in JSP - Java3D
JFree 3D Bar Chart not displaying in JSP  Hi I am trying to run JFree 3D bar chart written in your site under link: http://www.roseindia.net/chartgraphs/3Dbarchart-in-jsppage.shtml This is not working. PNG file
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
Advertisements
3D Bar Chart
3D Bar Chart       In this section we are providing you an example to create a 3D Bar Chart. Description of Program  For creating a 3D Bar chart we use the object
Create a 3D bar chart in JSP page using JFreeChart
Create a 3D bar chart in JSP page using JFreeChart... to create a 3D bar chart in jsp page using JFreeChart. Code given below creates a bar chart of scores of two teams in matches. In the code given below
Dynamin Jfree chart in jsp---error
Dynamin Jfree chart in jsp---error   While compiling this CODE...); JFreeChart chart = ChartFactory .createBarChart3D( "Stock Update", "runs...); try { ChartUtilities.saveChartAsJPEG(new File("c:\\chart.jpg"), chart
Stacked 3d Bar Chart Example using JFreeChart
Stacked 3d Bar Chart Example using JFreeChart... a Stacked 3d bar chart using JFreeChart. Bar chart will represent the score...(): This method is used to create stacked bar chart for given values. It takes
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
jfree chart
jfree chart  i need donut chart using jfree
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
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
3d pie chart - Java3D
3d pie chart  Dear Sir, i want to create 3d pie chart using jsp, i have some code for 2d pie chart in jsp and 3d pie chart in applet. for 2d pie chart my jsp page is running properly but for 3d i used some code from applet
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  thanks for reply...) org.apache.jsp.bar<em>jsp.</em>jspService(bar_jsp.java:57...,true, true, false); ChartFrame frame1=new ChartFrame("Bar Chart",chart
create bar chart in jsp using msaccess database
create bar chart in jsp using msaccess database  type Exception...\work\Catalina\localhost\chetana\org\apache\jsp\bar_jsp.java:57: cannot find symbol... to compile class for JSP An error occurred at line: 8 in the jsp file: /bar.jsp
JFree chart package error
the jcommon jar file and jfree jar file for the bar chart code. but now its giving...JFree chart package error  hi, I had asked u abt the jfree chart package and done what u have said. Its working but its giving me error that some
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
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
JFREE chart - Java Beginners
JFREE chart  how can i get the latest save image of my action class.....thanks,i want my chart to display dynamically from my database  Hi... database on your chart
how to create bar chart in jsp using msaccess database
how to create bar chart in jsp using msaccess database  type...\Tomcat 5.0\work\Catalina\localhost\chetana\org\apache\jsp\bar_jsp.java:61: cannot...: Unable to compile class for JSP An error occurred at line: 10 in the jsp file
how to create 3d chart in dojox charting - XML
how to create 3d chart in dojox charting  Please provide some example for 3d charting in dojox chart
Bar Chart
Bar Chart  hi...... Thanks 4 ur help for the bar graph creation i have got what i wanted. But now want to ask that in that bar graph i want multiple bar on one value means I want to create a graph where on my x-axis i have
Create a bar chart in JSP page using JFreeChart
Create a bar chart in JSP page using JFreeChart... to create a bar chart in JSP page using JFreeChart. Code given below creates a bar chart...(): This method is used to save chart in to png format. jspbarchart.jsp
Jfree chart problem - Swing AWT
Jfree chart problem  hello i have a problem related to jfree chart i have some data and i want to display data in two different chart stacked area chart and line chart both in a single frame. That is hybrid combination
Bar chart implementation in PHP
Bar chart implementation in PHP  How to implements reports in bar graphs by using PHP
3D Pie Chart
3D Pie Chart       In this section we are providing you an example to create a 3D Pie Chart. Description of Program :    For creating a 3D Pie Chart we use
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
Pie chart Jfree create error
Pie chart Jfree create error  hi........... thanks 4 ur help but when i am using the code which has a import file import org.jfree.chart.*; its giving me an error that " package org.jfree.chart does not exists " can u help me
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
Bar charts and jsp
Bar charts and jsp  Hi, How to generate Dynamic Bar Chart Images using jsp with placing any image location in weebroots? Thanks in advance
Create Bar Chart with database values
createBarChart3D() of the class ChartFactory creates a vertical 3D bar chart. Now...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
hybrid graph (jfree chart) - Swing AWT
hybrid graph (jfree chart)  hello i have a problem related to jfree chart.I want to display hybrid graph (Stacked Area and Line ).combination of stacked area chart and Line chart in one frame. Plese anybody help me out
Bar Chart
Bar Chart       In this section we are providing you an example to create a Bar Chart. Description of Program  For creating a Bar chart we use the object
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
Bar chart with J table
Bar chart with J table  Hi I'm new in Java and I have a application... tell me how can I make a bar graph that will display the data from my table.I tried using the code from your page (http://www.roseindia.net/chartgraphs/bar
Draw Statistical chart in jsp
chart in jsp by getting values from database.. To draw a bar chart, we have... createBarChart3D() creates a vertical 3D bar chart. The class PlotOrientation is used.../jsp/bar.jsp to the address bar and hit enter. The image of chart is displayed
java bar charts and jsp
java bar charts and jsp  Hi, Can any one help me out in how to create java bar charts using jsp with the help of data base table values? thanks.../jsp/draw-statistical-chart-jsp.shtml
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... the database.now i have to pass this arraylist object to a jsp page and on that jsp page... it.please reply soon.I am attaching my servlet and jsp page beneath. please reply
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
jfreechart displaying chart from access database
jfreechart displaying chart from access database  I have these 2... and then the chart should be displayed on a jsp..how can i do it..pls reply..its..."); JFreeChart chart = ChartFactory.createBarChart("MARKS INFORMATION
JFreechart Stacked Bar Chart
JFreechart Stacked Bar Chart JFreechart provides a way to create various... Bar Chart. This chart actually displays the result of multiple queries stacks... = ChartFactory.createStackedBarChart( "Stacked Bar Chart", "Games
line chart from database in jsp
line chart from database in jsp  how can i create line chart from database in jsp code
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
Displaying Date in jsp - JDBC
Displaying Date in jsp  I want to insert Date of birth of a person in a database.i am getting input value from HTML and i use jsp application to interact with database.My JSP code for inserting Date is below: String dateStr
Displaying image using jsp and spring.
Displaying image using jsp and spring.  how to display an image stored in WEB-INF/images folder on the browser using jsp and spring
Stacked Bar Chart Example using JFreeChart
Stacked Bar Chart Example using JFreeChart... a Stacked bar chart using JFreeChart. Bar chart will represent scores of two team... to create stacked bar chart for given values. It  takes title, domain axis
Bar Chart in Java
Bar Chart in Java      ... to draw simple bar chart in Java. A bar chart (bar graph) is a way of comparing two... chart in Java. To draw a bar chart, the variables minvalue, maxvalue of double type
Displaying Rows - JSP-Servlet
Displaying Rows  Hi, I need your support on how to display data from ms sql 2000 database into an html form text box and text area, using java servlet or jsp  Hi friend, This is form code, display data
Stacked Bar Chart using JFreeChart
Stacked Bar Chart using JFreeChart   ... bar chart using JFreeChart. In the code given below we have extended class.... createStackedBarChart(): This method is used to create stacked bar chart for given values
Chart & Graphs Tutorials in Java
.    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... an example to create a Bar Chart.   3D Bar Chart Example
create chart - JSP-Servlet
.jrxml report. I want to create a chart using ireport software. I m using sql...(primary key) title status I want to show chart of field "date" only... and free hours is green are filled that chart So pls help me to solve
Uploading a software and displaying it on the jsp page
Uploading a software and displaying it on the jsp page  I have a Downloads page in my website, I want it to display the name of softwares as soon as it is uploaded in the backend by the administrator. And the admin may be a non

Ads