Dynamin Jfree chart in jsp---error

Dynamin Jfree chart in jsp---error

 While compiling this CODE:  
    <%@ 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"%>
    <%@ page import="org.jfree.chart.renderer.category.CategoryItemRenderer"%>
    <%@ page import="org.jfree.chart.plot.CategoryPlot"%>
    <%@ page import="org.jfree.chart.plot.PlotOrientation"%>
     <%@ page import="java.awt.Color"%>
    <%
    String query="SELECT * from Cricket";
    JDBCCategoryDataset dataset=new JDBCCategoryDataset("jdbc:mysql://localhost:3306/mysql",
    "com.mysql.jdbc.Driver","root","roohi");

    dataset.executeQuery( query);
    JFreeChart chart = ChartFactory .createBarChart3D(
    "Stock Update",
    "runs",
    "overs",
    dataset,
    PlotOrientation.VERTICAL,true, true, false);

    CategoryPlot plot = chart.getCategoryPlot();
    CategoryItemRenderer renderer = plot.getRenderer();

    renderer.setSeriesPaint(0, Color.green);
    try
    {
    ChartUtilities.saveChartAsJPEG(new File("c:\\chart.jpg"), chart, 500, 450);
    }
    catch (IOException e)
    {
    System.out.println("Problem in creating chart.");
    }
    %>


Generated error:
<identifier> expected
public class {

Please help out on this
View Answers

January 19, 2012 at 4:33 PM

Post error details.

Have a look at the following link:

http://www.roseindia.net/jsp/draw-statistical-chart-jsp.shtml









Related Tutorials/Questions & Answers:
Dynamin Jfree chart in jsp---error
Dynamin Jfree chart in jsp---error   While compiling this CODE...("Problem in creating chart."); } %> Generated error: <... error details. Have a look at the following link: http://www.roseindia.net/jsp
jfree chart
jfree chart  i need donut chart using jfree
Advertisements
JFree chart package error
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... the jcommon jar file and jfree jar file for the bar chart code. but now its giving
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
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
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
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
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 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
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
JSP Error Page
JSP Error Page          JSP Error Page is used to specify the custom error page and runtime error occurs with an exception being thrown, the custom
Jfree exception
Jfree exception  import java.sql.*; import org.jfree.chart.... org.jfree.data.xy.*; import org.jfree.data.*; public class Chart{ public static... = new XYSeriesCollection(series); JFreeChart chart
Jfree exception
Jfree exception  import java.sql.*; import org.jfree.chart.... org.jfree.data.xy.*; import org.jfree.data.*; public class Chart{ public static... = new XYSeriesCollection(series); JFreeChart chart
JSP error page - JSP-Servlet
JSP error page  Hi i have 1000 of JSP. but we coded it without adding... the exception occured in JSP. is there any short cut i can do? do not want to add this line.../DAO/bean layer and not in the JSP. let me know if you have any idea. Thanks
JFREE error
JFREE error   hi......... the code for making chart is: WHICH IS GIVING THE ERROR import org.jfree.chart.*; import org.jfree.data.category...."); JFreeChart chart = ChartFactory.createBarChart ("BarChart using JFreeChart
chart tutorial - Java3D
chart tutorial  Hi I need a JFree Chart class library in order to design a chart with java  Hi friend, For JFree Chart class library... information,Tutorials and Examples on JFree Chart visit to : http://www.roseindia.net
JSP Error 500
JSP Error 500          JSP Error 500 is to generate error status 500 in jsp.  The Error 500 occurred when the server encounter an internal error
jfree - Java Beginners
(300,300); } } For more information,Examples and Tutorials on jfree chart...jfree  how use the "import jfree" on jdk1.5.0_6,,? or how to plot... xyDataset = new XYSeriesCollection(series); JFreeChart chart
jsp error
jsp error  <p>hi, could please help whenever i run jsp file in my eclipse i got this error.my jsp file is</p> &lt;%@ page language... encountered an internal error () that prevented it from fulfilling this request
JSP error
JSP error  what is difference between global-exception and error-page in jsp. which condition they are use
Artifacts of jfree
List of Artifacts of jfree maven depenency
Jfree - Java Beginners
on jfree chart visit to : http://www.roseindia.net/chartgraphs/ Thanks...(20)); pieDataset.setValue("Six", new Integer(10)); JFreeChart chart = ChartFactory.createPieChart ("Pie Chart using JFreeChart", pieDataset, true,true
Jsp error when i run this a jsp file
Jsp error when i run this a jsp file  hi I got this error when i run the jsp file in IDE and outside also please help me java.lang.NullPointerException org.apache.jsp.insertjsp.jspInit(insert_jsp.java:22
JSP error: class UserForm not found in class model.UserAction
JSP error: class UserForm not found in class model.UserAction  etting the following error in the program..wat shod i do to remove this?I am using jdeveloper 10 g [code] package model; import javax.servlet.http.HttpServletRequest
hybrid chart(Stacked Area and Line ) - Swing AWT
hybrid chart(Stacked Area and Line )  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
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
Version of jfree>jcommon dependency
Version of jfree>jfreechart dependency
Version of jfree>jfreereport dependency
i want to show timeline chart for three year in chart..
i want to show timeline chart for three year in chart..  I am using Jfree chart library to display chart in web pages. i want to show three year data in chart in 3 lines for three year in same chart. i am able to show
JFree - Java Beginners
JFree  how to import JFree to jdk1.6.0_05, not to new version,, or how to get java new version (that used JFree ) ? regads  Hi friend, For solving the problem visit to : http://www.roseindia.net/chartgraphs
jfree - Java Beginners
jfree  how use the "import jfree" on jdk1.5.0_6,, or how to plot data in xy line on jdk1.5.0_6
pie chart
pie chart  how to create pie chart using struts2
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how to solve this problem? plz help?   Download jcommon-1.0.16.jar
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how to solve this problem? plz help?   Download jcommon-1.0.16.jar
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how to solve this problem? plz help?   Download jcommon-1.0.16.jar
jfree missing import file
jfree missing import file  hi....... i have checked the jar file of jfree that import file of RECTANGLEINSETS is not there then what to do now? how to solve this problem? plz help?   Download jcommon-1.0.16.jar
Pie chart
Pie chart  hi................. In my project i want to create a pie-chart by taking values at run time. As want to display it in pie chart form....   Java Swing PIE Chart
jsp error - JDBC
jsp error   in this code the else part is nt executing atall... of that a error is like-----------"java.sql.SQLException: [Microsoft][ODBC Driver Manager... the line is not getting incremented u r getting that error just do this change
jsp error - JSP-Servlet
jsp error  HTTP Status 404 - /jsp... message /jsp/ description The requested resource (/jsp/) is not available..., The 404 or Not Found error message is an HTTP standard response code indicating
jsp error - JSP-Servlet
jsp error  To Upload and insert the file into oracle Database with Current Date and Time In JSP and my project is online library management system plz help how to store some books in particular folder and after how retrive
jsp error - JSP-Servlet
jsp error  Hello, my name is sreedhar. i wrote a jsp application to generate a report from oracledata base and the report should display in Ms-excel... in detail. Visit for more information. http://www.roseindia.net/jsp/ Thanks
JSP Error - JSP-Servlet
JSP Error  When i am running my registration.jsp getting following error. HTTP Status 500... description The server encountered an internal error () that prevented it from fulfilling
jsp error - JSP-Servlet
jsp error  how to remove below error:: exception org.apache.jasper.JasperException: java.lang.NullPointerException root cause...... newpo.jsp:   JSP Page
Jsp Error - Development process
Jsp Error  Hi, While executing following code "View_Service.jsp" , am getting Internal Server Error java.sql.SQLException: [Microsoft][ODBC...(JdbcOdbcStatement.java:288) at jsp_servlet.__add_data._jspService(__add_data.java:146
Jsp Error - Development process
Jsp Error  Hi, While executing Add_Data.jsp , am getting following error. "Data type mismatch in criteria expression." "View_Data.jsp...) at jsp_servlet.__add_data._jspService(__add_data.java:146
JFREE error again
JFREE error again  hi......... As i had asked u the jfree error i want to tel u that i have taken the both the jar files jfree and jcommon. but then also its giving me error i am able to compile the code but now when i am
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
Version of jfree>jfreechart-experimental dependency
Version of jfree>jfreechart-swt dependency

Ads