This Example shows you how to create a area chart in JSP page using JFreeChart. Code given below creates a area chart of runs of two teams in different matches.
Create area chart in JSP page using JFreeChart
This Example shows you how to create a area chart in JSP page using JFreeChart. Code given below creates a area chart of runs of two teams in
In the code given below we have extended class ApplicationFrame to create a frame and also pass a string value to the constructor of ApplicationFrame class by using super keyword that will be name of the created frame.
Methods used in this example are described below:
pack(): This method invokes the layout manager.
centerFrameOnScreen(): This method is used for the position of the frame in the middle of the screen.
setVisible(): This method is used for display frame on the screen.
createCategoryDataset(): This method is used to create the instance of CategoryDataset Interface and that contains a copy of the data in an array.
createAreaChart(): This method is used to create bar chart for given values. It
takes title, category axis label, value axis label, dataset, Plot Orientation, legend, tool tips and urls as parameters.
saveChartAsPNG(): This method is used to save chart in to png format.
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
February 2, 2012
I am not able to import "org.jfree.chart.*....can anybody tell me what i need ti include in jar files. so that i will be able to import it...
i have already added jcommon-1.0.17.jar and jfreechart-1.0.14.jar in lib folder of tomcat.....
please email me on email@example.com
April 21, 2012
Problem with this example
C:\Documents and Settings\sourav\My Documents\NetBeansProjects\Gnatt\nbproject\build-impl.xml:575: Java returned: 1
BUILD FAILED (total time: 0 seconds)
April 20, 2012
Chart from Database
Hi, can you give me the code with it i can get linechart from oracle database
August 29, 2012
IMG SRC not work
I copy this code, the image is generated but no display
final File file1 = new File("C:/Users/user/Documents/loginStruts/areachart.png");
<IMG SRC="C:/Users/user/Documents/loginStruts/areachart.png" WIDTH="400" HEIGHT="400" BORDER="0" USEMAP="#chart">