All things are correct it is giving error in the below code of line final JFreeChart chart = ChartFactory.createAreaChart("Area Chart", "", "Value", dataset, PlotOrientation.VERTICAL,true, true, false); telling that The method createAreaChart(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean) in the type ChartFactory is not applicable for the arguments (String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean) everything is correct seems, dont bother about the names these are correct, also CategoryDataset and the PlotOrientation are correct I have given the warning and error in the underline lines above. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Regards Chandan
cmaheshwari16
Posts
-
Jfreechart with jsp and servlet giving error -
Jfreechart with jsp and servlet giving errorHi All, I am using JSP and servlet technology for making graphs. Below please find my jsps, Display.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ 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.CategoryItemRenderer" %>
<%@ page import="org.jfree.chart.urls.*" %>
<%@ page import="org.jfree.data.*" %>
<%@ page import="org.jfree.data.CategoryDataset" %><%
final double[][] data = new double[][]{{210, 300, 320, 265, 299},{200, 304, 201, 201, 340}};final CategoryDataset dataset = DatasetUtilities.createCategoryDataset("Team ", "", data);
final JFreeChart chart = ChartFactory.createAreaChart("Area Chart", "", "Value", dataset, PlotOrientation.VERTICAL,true, true, false);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setForegroundAlpha(0.5f);chart.setBackgroundPaint(new Color(249, 231, 236));
try {
final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());//String sname = request.getRealPath("/");
//sname = sname.concat("web/areachart.png"); //out.println(sname); //file = new File(sname);
//final File file1 = new File(sname);
File file1 = new File("../webapps/jspGraphFunction/web/areachart.png");ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info);
} catch (Exception e) {
out.println(e);
}%>
JSP Page
Now its giving the below error for the bolded statement in the code: Quote: The method createAreaChart(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean) in the type ChartFactory is not applicable for the arguments (String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean) On net only this way of using the jfreechart is given I ha
-
How to use jFreechart in struts2Pls help and provide the way .....
-
How to use jFreechart in struts2Hi All,
I am little bit new to struts framework though I have used tiles in struts application. Now I want to display charts in my application. After searching I found jFreechart library to create charts. (Though it doesn't generate all the charts, like box in web application).
Now I also found some link on how to use jFreechart in struts application. Though the post are not much descriptive, I tried in the same way to incorporate the chart functionality but it is not working......
Can someone please provide the entries to be made in [B]struts.xml[/B], [B]web.xml[/B] to make this functionality work.
Pls find below the different files I am using to run my application.
I have made the changes that I made for graph functionality in bold[B][I][U]Struts.xml[/U][/I][/B]
[CODE]<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts><constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<!--
<package name="actionGraph" namespace="/actionGraph" extends="jfreechart-default">
<action name="Graph" class="graph.Graph">
<result name="success" type="chart">
<param name="value">chart</param>
<param name="type">png</param>
<param name="width">640</param>
<param name="height">480</param>
</result></action>
</package>
--><package name="portal" namespace="/portal" extends="struts-default , [B]jfreechart-default[/B]
"><result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>\[B\]<result-type name="chart" class="org.apache.struts2.dispatcher.ChartResult"> <param name="height">150</param> <param name="width">200</param> </result-type>\[/B\]
</result-types>
<global-results>
<result name="error">/pages/error.jsp</result>
</global-results><global-exception-mappings>
<exception-mapp -
How to read an HDF file and convert it into ASCII file(extension) using C programmeVery thanks for your reply.... Only documentation is not helpful, I need a way to read that particular file in a format it is written to convert it to text. Thanks
-
Cannot use mysql in linux fedora14. Do we have to install it or the bydefault coming is fine.Hi I have not installed mysql on my own, its the default one that is coming with fedora14 at /usr/local/mysql I am giving you some screenshots, please check if you can find out something. ********************************************************************************************************************************************************* The first issue is while I login using command mysql -u root -p it asks for password I enter, root123 then gives the error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) let me give you the full flow: I am using fedora 14 _________________________________________________________________________________________________________ in root I fire the below commands: [starting the mysql] [root@chandan init.d]# /etc/init.d/mysqld start Starting mysqld: [ OK ] now from my local account I try to login to sql, [chadan@chandan ~]$ mysql -u root -p Enter password: [i give password as root123 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) But when I login using command [chadan@chandan ~]$ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.51 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> [here I am able to login to server but when I try to create database then it gives error] mysql> create database dummy; ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'dummy' mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ ********************************************************************************************************************************** NOW THE SECOND ISSUE WHEN I START THE SERVER IN DIFFERENT WAY. [root@chandan init.d]# mysqld_safe --skip-grant-tables & [1] 29006 [root@chandan init.d]# 110219 18:33:25 mysqld_safe Logging to '/var/log/mysqld.log'. 110219 18:33:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql Now from my account I try to logi
-
Programme to add given no of days to the current date to give the resulted dateHi Richard, Now its more clear...... Thanks
-
Programme to add given no of days to the current date to give the resulted dateThanks Richard..... But I was expecting some live example to get the clear understanding... Its now done by using the below way just creating the object of struct tm and then giving the values to the variables of the structure adding the days to the tm_mday variable using the mktime() function, converting it back to a structure..... and then accessing the required values with the structure variable... I still want to understand the use of the time_t.......if u can......
-
Programme to add given no of days to the current date to give the resulted dateSir Thanks for your reply I am working on linux.... and the link you have given... I dont find any function which can add some day to the particular date to give new date. Thanks
-
Programme to add given no of days to the current date to give the resulted dateHi All, I want a C programme which will take a user input as a date and number of days, and then it will add the given number of days to the input date and will give the resulted date. It should keep in mind all the permutation and combinations like changing month year , leap year, some months have 31 days some have 30 days etc.... for eg.: input date 2010-12-25 days 20 result 2011-01-14 This programme can be made but this will take a lot of time if anybody has similar to that or exact programme then please help.... its just a module. Thanks
-
How to read an HDF file and convert it into ASCII file(extension) using C programmeHi, I have an hdf (extension )file , i need to read that file and convert it into an ASCII format using C program. The problem is small but not finding a way. Thanks
-
how to allocate memory dynamically for 2 dimensional array and use that pointer like and array....Hi All, I want to declare memory dynamically for a 2 dimensional array. and then want to use that pointer like an array. as i am using ANSI compiler so there is no need to typecast the return type of the memory block returned by malloc() so if i will write the inline code line as arr=malloc (nrows*5*sizeof(int)); its working correctly but i just want to know to be at the safer side that if i will be using the old compiler how to type cast the same as arr=(int [] *)(malloc (nrows*5*sizeof(int))); this is giving error.(i am on linux) thanks
#include
#include
int main()
{
int nrows=2,i,j;
//int arr[nrows][5];
int (*arr)[5];
arr=(int [] *)(malloc (nrows*5*sizeof(int)));
for(i=0;i -
how to use database made in SQL server compact edition 3.5 into MS SQL server 2005 express editionhi all, MS SQL server compact edition comes with VS 2008. I made database in that . Now i want to use the same database in MS SQL Server 2008 Express edition Thanks
-
Wait it looks same but its diff read the problem:- how to connect the ASP.NET with sql server 2005 express edition . [modified]hey u deleted your mail ID , i have to mail u that code , and i have used that exception, i am redirecting to Error.aspx if any error comes. you once again give me ur mail id thanks
-
Wait it looks same but its diff read the problem:- how to connect the ASP.NET with sql server 2005 express edition . [modified]hi , how to connect to the database and how to provide the GUI as I said that i dont have VS. Please cant u favour me just give me some hint for login only ... also below please find my login coding... login.aspx.cs
protected void btnLogin_Click(object sender, EventArgs e) { if (Session["Admin"] != null) { if (txtPassword.Text.ToUpper.Equals(Session["Admin"])) Response.Redirect("Homepage.aspx"); } String except = null; DataValidation dv = new DataValidation(); String pass = txtPassword.Text; String password = null; password = dv.loginIn(txtUserName.Text); if (password==null) { //Session["Exception"] = except; Session["SourceFile"] = Formname; Response.Redirect("Error.aspx"); txtUserName.Text = "Exception"; } else if (password.Equals(pass)) { //txtUserName.Text = "Success"; Session["User"] = txtUserName.Text; if (Session["User"].ToString().ToUpper().Equals("ADMIN")) Session["Admin"] = "ADMIN"; Response.Redirect("Homepage.aspx"); } else { lblCheck.Text="Invalid UserName or Password"; //Response.Redirect("LogIn.aspx"); } }
the DataValidation function[this is one .cs file i have maintained for data validation]public String loginIn(String userName) { String queryBuilder; { DataBaseConnection ds = new DataBaseConnection(); queryBuilder = "SELECT Password FROM User_Master WHERE UserName = @uname"; String pass = ds.loginDataBase(userName, queryBuilder); return pass; } }
the DataBase connection functionSqlConnection getConnection() { SqlConnection cn = null; { cn = new SqlConnection(); cn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); return cn; } } public String loginDataBase(String userName, String queryBuilder) { SqlConnection sqlcon = null; try { sqlcon = new SqlConnection(); sqlcon.ConnectionS
-
Wait it looks same but its diff read the problem:- how to connect the ASP.NET with sql server 2005 express edition . [modified]hi Murugesan, thanks for ur response but can u just explain the points that i made in the previous quote. also there are many Fx SDK versions available like Java win SDK....which to download and install and is it free? as for rules cannot install the licensed version. What do you mean by
write a single test page with complete diagnostic.
Thanks.
-
Wait it looks same but its diff read the problem:- how to connect the ASP.NET with sql server 2005 express edition . [modified]Hi vuyiswa, Thanks for giving so much time i reading this and giving the reply.
You wrote :
Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-How do you know that you cant connect , if you cant see the error ?
Because when i enter hte username and password that there in the database table User_Master[that has been converted to dbo.User_Master] , i cannot loog on to. Inspite it redirects me to the locgin page again. Also I cannot debug the prog as i dont have VS 2008. To check this whats happening , i tried one thing:- On login page [in coding,aspx.cs page], i commented the line which checks whether the username and password is valid or not [ which fetches data from the database] and simply redirected to the Homepage.aspx. It works fine. On one page [in coding,aspx.cs page], i commented the line which checks whether the session for userlogin is there or not[in login page if the user is authenticated i have saved his username in session and checked this session on everypage , if the session is not null then only user can see that page]. So now when i browse that page through IIS server the page is opening(ofcourse, it will) i enter all the data in the text fields. When i submit the button [which enters the data to the tables] it gives me that dirty yellow page. [as i said earlier i cannot debug the programme without VS or there is any way]
You wrote :
Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-How do you know that you cant connect , if you cant see the error ?
Because if it connects then there is some problem related with database, and if there is some problem with database then i have redirected it to the Error.aspx page.
You wrote :
2> I have to make some changes in the connectivity[in web.config or some other location]what is your Question Regarding this ?
As now i am not using the default D/B provided by the VS2008 and using SQL Server 2005 express edition, so are there any changes i
-
Wait it looks same but its diff read the problem:- how to connect the ASP.NET with sql server 2005 express edition . [modified]hi All, I just wanted to know the following things if u can just help me. I made a website in Visual Studio 2008 and used the database provided by the VS [I dont know which version is this]. That website runs successfully on the machine having visual studio[As in that i just attach my database through the GUI provided by VS]. Now I want to deploy that website on a LAN. I have the database in .ldf and .mdf format. But I dont know whether it is in sql 2005 or sql 2008[as i made it through Visual Studio GUI] Now the system in which i have to deploy cannot have a licensed product. So i have to convert that database either to open source or an free version of sql server. I chose to go for SQL Server express edition that is free. Now the prolem being whether I use SQL Server 2008 or 2005 as i dont know which database was provided by the VS.[when i made that databse] But the problem being that on the system in which i have to deploy does not contain VS. Supposing it provides SQL Server 2005 express edition I permormed the following test:- Now i have installed .NET framework 3.5, MS SQL server 2005 Express Edition and the SQL Server management studio that is a GUI for handling d/b. Now when I attached that database[that i have, of which i dont have the version]. I can see the database and tbles and all the contents that was there in the d/b.[through that management studio GUI]. Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:- 1> The database that i have is in SQL server 2008 express edition or something else. 2> I have to make some changes in the connectivity[in web.config or some other location] NOTE: Also when i connected the d/b in management stuio it shows all the tables with dbo as a prefix. for eg. suppose i had a table as User_Master than its showing as dbo.User_Master. please guide me if u can. Waiting for ur reply.
modified on Wednesday, October 6, 2010 3:23 AM
-
Import data from default VS 2008 D/B to MS SQL 2005 express editionhi All, I am new to this and first time doing this kind of work. i have created a web site in visual studio 2008 with database provided by the visual studio. Now i have that database but i have to deploy that website and use database as sql server 2005 express edition as it is free. I have the database with me how to do that do i have to make the database again in Sql server2005 express edition please help Regards and Thanks