Pie Chart in JSP
Hi
I want to create a Pie Chart in JSP. The data will come from Oracle Database. I am not very good with managing big open source projects like Cewolf to draw charts. Is it possible to do this in the simplest way possible as I am not experienced in this technology.
Please send me the link to the simplest way to do it or guide me.
Thanks in advance.
Thanks alot. The example shown works fine on my local
machine where I have got TomCat but it does not work
on my university server as they say they do not have
graphics card on their server and therefore any
java.awt or swing class can not be used on server sideSo I guess you have to use another server's capability, like the one in play-free-games.com, for example :
http://www.play-free-games.com/webmasters/dynamic-piechart/dynamic-piechart.cfm
Similar Messages
-
how to create pie chart in jsp based on sql server 2000 database
please give example or code with explanationhttp://sourceforge.net/projects/jfreechart
- Saish -
How can we create dynamic pie chart in jsp
hi im a new jsp programmer and i just want to know how can i create dynamic pie chart in jsp
http://sourceforge.net/projects/jfreechart
- Saish -
How to create a pie chart with jsp/servlet?
I want to create a servlet which can be used like below:
<img src="pieservlet?param1=<%=x%>¶m2=<%=y%>&..." width="100" height="100" >
can you give me some guide?Hai ,
I have implemented a trial working pie chart , dynamically created from jsp using ServletOutputStream , BufferedImage & JPEGImageEncoder (found in com.sun.image.codec.jpeg.* package & bundled along with jdk ) .
<%
ServletOutputStream sout = response.getOutputStream();
response.setContentType("image/jpeg");
BufferedImage img = new BufferedImage(400,400,BufferedImage.TYPE_INT_RGB);
Graphics2D gr = img.createGraphics();
/* Actually this will be got as values of request.getParameter */
Vector values = new Vector();
values.addElement(new String("45") );
values.addElement(new String("125") );
values.addElement(new String("75") );
values.addElement(new String("25") );
values.addElement(new String("90") );
// my demo class
temp.pieChart fr = new temp.pieChart(400,400,values);
/* This pieChart is class extends JFrame , in paint method of it all Drawing of pie chart using graphics2D fillArc done */
fr.paint(gr);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sout);
encoder.encode(img);
sout.flush();
%>
Hope this helps to build your own custom pie chart .
Let me know if details needed on pieChart class
rakesh
-
I want to display some stats using a pie chart in jsp/java plz guide me
i am working on struts framework .the view is in jsp and coding in java.
i have value in the database and have to display them using a pie chart.
Edited by: kapil_scwcd on Jan 10, 2010 8:10 PMYou can use JFreeChart which is a free and good tool to generate graphs in Java. It has samples and other guides which you can use to get started...
-
Drill Down feature for pie chart in JSP
Hi,
I need to have drill down feature in my Pie Chart which is generated using JFreeChart package. The pie chart is generated dynamically basing upon the database values as inputs .
Now on click of any one sector i have to show other bar graph. The bargraphs would be different for different sectors clicked.How to use Mouse Listener? How can track or keep check on the boundaries of different sectors?.
Please help me on this issue.
Thanks in advance,
Praveen@OP: don't ask the same question in two different threads:
http://forum.java.sun.com/thread.jspa?threadID=5121491&messageID=9424672#9424672
kind regards,
Jos -
Hi Guys..
I want to to have a output from jsp page in the form of Piechart. What all should I use??
Regards,
NachiketYou can use JFreeChart which is a free and good tool to generate graphs in Java. It has samples and other guides which you can use to get started...
-
Hi all,
I have found (in the jdc) that it seems to be difficult to create a dynamic (data coming from db) Pie chart using JSP page. I did a beans that create basic Bar charts. Is there any way to do the same for a pie charts ? (without commercial solutions).
I'll prefer a Beans instead of a applet, but at least this solutions can be take.
Thanks a lot
STFHiLearningSTF,
Here I am giving you sample code below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Pie Bean</title>
</head>
<body>
<h2>Pie Chart Bean Example</h2>
<%@ page import="com.sas.graphics.chart.*" %>
<%@ include file="Sampledata.inc" %>
<jsp:useBean id="pie" class="com.sas.servlet.beans.graphics.html.Pie"
scope="session">
</jsp:useBean>
<%
// Set the model
pie.setModelInterface(dataModel);
pie.setTitle("Product Sales");
pie.setPieLabelType( com.sas.graphics.chart.PieLabelTypes.SECTOR_WEIGHT );
DiscreteColorLegendStyle discreteLegendStyle = pie.getSectorLegendStyle();
discreteLegendStyle.setColorScheme(com.sas.graphics.chart.ColorSchemeTypes.INDUSTRY );
discreteLegendStyle.setVisible( false );
PolarLegendStyle polarLegendStyle = pie.getWeightLegendStyle();
polarLegendStyle.setStartAngle( 180.0D );
// Output the Pie
pie.setHeight(300);
pie.setWidth(400);
pie.setRequest(request);
pie.write(out);
%>
</body>
</html>
I hope this will help you out.
Regards,
TirumalaRao.
Developer TechnicalSupport,
sunMicroSystem,India. -
Hi guys,
I am trying do generate a pie chart using JSP or Servlet. I tried out the codings at the www.builder.com site.
But it's not working as it returns "index array out of bounds 0" error.
Has anyone tried it before...
Any help would be much appreciated
the url for the site
http://builder.com.com/5100-6370-1051766.html?tag=searchThe comple JSP code from the site is at :
http://builder.com.com/5110-6370-1051781.html -
CR 8.0 pie chart/graph doesn't appear in web browser
Post Author: kevind
CA Forum: Charts and Graphs
Hi,
I am using a CR 8.0 report (containing data in tabular format and Pie/Bar graph) with Web component Server.
In design mode (by entering the parameters) when i view my report through the CR IDE then i can view my report perfectly with the pie and bar graphs.
However,once i call the same report through the web component server, by my JSP page, the report appears with the data but the page containing the piechart/Bar graph doesn't appear. (i am using the ActiveXViewer)
When i remove the chart/graph, then all the pages are displayed in my browser (IE) properly, but if i add back the pie chart then the page on which this should appear - doesnt display.
Has anyone faced a similar issue? In design it displays with data but once called through webcomponent server it fails?
Thanks,
Kevin DHello Subramaya,
currently I am working on a small article in the Wiki area of the ITS (Wiki, ITS HowTos): <a href="https://wiki.sdn.sap.com/wiki/display/HOME/UsingSAPGUIforHTMLinsteadofanIAC">Using SAP GUI for HTML instead of an IAC or EWT service</a>.
Also see notes 1010519, "SAP GUI for HTML: Simplified Title Area Without Menu and OK Code" and 959417, "Integrated ITS, Closing Session When Transaction Ends". I am pretty sure that this is exactly what you are looking for.
With best regards,
TJ -
Hi all,
I'm a beginner in java and i'm investigate in a web project (website) which should display statistical charts. I did a beans to generate basic bar charts, but it's most difficult to build a pie chart. That's why i need help to put me on the right way of building a Piechart beans.
All kind of help will be precious
Thanks in advance.
STFThanks a lot for your reply.
But it shall works in a beans and this was set up only for applications or applet. Besides it seems (i'm really not sure but i have found lot of thread)that an applet can't be run into a jsp page that is searching data into db (thanks to sql query)
: there is a problem of buffer (tomcat can't generate the jsp page in the same time as it execute the applet).
Let me know if i'm wrong or not please ?
Regards
STF -
How can I create a Pie charts ?
HI all,
I'm a beginner in java and i'm investigate in a web project (website) which should display statistical charts. I did a beans to generate basic bar charts, but it is most difficult to build a Pie chart. That's why i need help to put me on the rigth way to build Pie Charts beans (this pie charts should be filled up with db query).
Every kind of help will be appreciated.
Thanks in advance
Hope someone can help me.
STFI take it you constructed the bar graphs using html and images together?
Obviously it's a little more difficult to make a pie chart with html. Chances are that it will have to be an image rendered by a Servlet or JSP. I suggest looking at how to create images using AWT or swing. This will allow you to create a circle with different color slices and what not. Then you need a Servlet or JSP that will send the image out the output stream. You can then place an image tag in your html page like this <img src="http://myserver.com/PieChartServlet>
I'm actually working on an API myself that will render pretty histograms (line graphs), and hopefully pie charts down the road. It's going to be an open source project. I decided to make my own API when I looked at some others out there who were charging an arm and a leg for theirs. Chart Builder for example, it's like $6K for their java based API <choke>.
So if you're interested, or anyone else is, shoot me an email and I'll let you know when the beta is ready. [email protected]
-Derek -
Setting Destination URI of a Pie Chart Graph Programatically-OA Framework
Hi All,
I have created a OF Page with the following Regions one under the other:
1. PageLayoutRN
2. HideShowHdr1 - Hide/Show Header
3. TblLayout1RN - Table Layout
4. Tbl1RowLayout1RN - Table Row Layout
5. Row1CellFormat1RN - Cell Format
6. Row2CellFormat2RN - Cell Format
Basically I have a page with a hide/show header, which contains a table with 1 Row and 2 Columns, where 1 column contains an advanced table and the 2nd contains a Graph (Pie Chart).
In the Row2CellFormat2RN, I have a GraphTable Region under the name PieChart1RN, which contains a graph called graph1 of style Pie.
As per the OA Framework Development Guide (744832.1) for R12.1.1 on Graphs (Page 255), a Code snippet is provided for setting the Destination URI of the graph programatically.
This code is as follows:
if(webBean.getUINodeName().equals("region3"))
OAGraphTableBean g2 =(OAGraphTableBean)webBean;
g2.setDisplayDataMarkers(0, true);
g2.setDrillDownUrl(0, "OA.jsp?page=/oracle/apps/ak/pages/FWK_TEST_AGR_SUM&akRegionApplicationId=601&sal={@Salary}");
//Test line graph with data markers and drill-down
g2.setDisplayToolTip(1,true);
g2.setDisplayDataMarkers(1, true);
g2.setDrillDownUrl(1,"http://www.oracle.com");
} I have tried using this code to set the Destination URI for my graph.
However, it does not work.
I do not understand which region name to specify as when I displayed the value contained in webBean.getUINodeName(), it refers to PageLayoutRN.
In short, I am not being able to set the Destination URI. Even though I have ensured the Bubble Text Property is set to True.
Can someone pls. help me into adapting this code to my context?
Thks
RaviHi Kumar,
I have already done it.
However, it still does not work.
The controller code looks like it does not recognise my graph region at all.
Thks
Ravi -
PIE chart in Oracle 9i Reports
Hi,
I'm using Orcle 9i Report builder to create reports.I'm creating web-source and saving it as JSP.Now I want to add 'PIE' charts into my reports.But, when I'm using the 'Graph' option in 'Insert' menu,it's not creating the 'PIE chart' properly.Pls anybody help me know how can I create 'PIE chart'
Thanks in advance
Rajesh K.RHi Rajesh,
Suppose you want to show salaries of a few employees in a Pie Chart (this is just a dummy graph to explain the steps - you can build more meaningful graphs). So you want that each employee's salary should be shown as a percentage of the total. Follow these steps:
1. Use the query - Select empno, sal from emp
2. Go to the web layout, place your curson in the rw:dataArea tags, and choose Insert > Graph
3. In the Graph wizard, choose Pie Chart, select empno in X-axis, and sal in the Y-axis
4. In the "Layout" step, drag "sal" from groups into the slices field
5. Fill in the titles, etc, and click finish.
Click "Run to Web" in the builder, and you should see the pie chart in the web page.
Navneet. -
Drill Down feature for pie chart in Java
Hi,
I have a JSP where the graph displayed should have �Drill Down� functionality i.e. when clicked on any sector of Pie chart it should come up with other graph giving more details.
I need the code or how to proceed to get drill down feature.
If anyone has idea about �drill down� or any sites which can help me please reply.
Thanks in advance.
Praveen.You have to generate the image and the surrounding HTML using two seperate transactions; typically a JSP delivers the HTML and a servlet, invoked by the SRC URL of an image tag, provides an image.
Your HTML contains a form, and the image is displayed using a <Input type="image" .. Clicking on that submits the forn, providing X and Y coordinates as parameters to a servlet which can calculate which pie-slice has been clicked. You can't use a client-side image map because there are no suitable sensitive shapes available.
Maybe you are looking for
-
firefox has been running slower. When this happens I'll reboot my computer and this speeds up firefox. When I restarted the computer firefox would not open. Just the spinning wheel with no access to the tools. After I force quit - it says ignore or n
-
Can anyone help with my keychain password?
I recently updated my main login password but didn't restart my MacBook Pro until yesterday. Now it is asking me for my keychain password. I've tried every known password I have ever used and none of them work! I have logged off and then clicked on
-
Classify G/L Accounts for Document Splitting
hi all experts, could any one give me the path to Classify G/L Accounts for Document Splitting in sap 4.6 environment. kindly answer this queston urgently anil
-
Have downloaded the trial version of Aperture to test. When printing I am getting poor quality prints, as well as seeing horizontal lines approx 1cm apart all the way down the photo. Have just printed the same photo with iPhoto with no problems. I am
-
Sender File ContentConversion for 5 levels.
Hi Friends, I got a peculiar requirement. My scenario is flat file to Idoc. The main problem is on the source side we have 5 levels to handle. Pls give some suggestions how to handle if we have more than 3 levels. Regards, Jeevan.