How To Create Dynamic Pie Chart In Jsp
Dynamic Pie Charts
843833 Member Posts: 48,469 Green Ribbon
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
STF
Comments
-
843833 Member Posts: 48,469 Green Ribbon
HiLearningSTF,
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. -
843833 Member Posts: 48,469 Green Ribbon
The difference is that it is quite easy to create bar charts using tables in HTML if you are writing the system dynamically, but a pie chart has to be created as an image.
Take a look at some of the AWT demonstrations you downloaded with the JDK- I believe there are some relevant parts in those.
-
843833 Member Posts: 48,469 Green Ribbon
HI rao_indts ,
Thanks for your reply, your solutions is very interessant.
This enligth me, because now I know that this could be done thanks to a beans.But where did you find the used beans ??
Is it one of yours (developped by yourself) or is it a package that you found somewhere (where ?) ?Thanks
STF
(web development student) -
843833 Member Posts: 48,469 Green Ribbon
Hi TirumalaRao,
do you know how to write word document dynamically?
-
843833 Member Posts: 48,469 Green Ribbon
Hi Srikanth Kate,
The only things I have found on generate a dynamic word doc is in this thread http://forums.java.sun.com/thread.jsp?forum=48&thread=84577
I don't know you had a eyes on so...Regards
STF -
843833 Member Posts: 48,469 Green Ribbon
Hi LearningSTF,
Thanks for the reply. Still if you have any problem regarding this code please post the query.
I hope this will help you out.
Regards,
TirumalaRao.
Developer TechnicalSupport,
Sun MicroSystem,India. -
843833 Member Posts: 48,469 Green Ribbon
Hi,
Thanks for your reply too, your help is precious.
But, in fact, I already did the query and the statistical statment and both works fine.
I'm working on a subject which is create a intranet web site which should be able to show statistical data (by charts) coming from the Remedy (oracle) databaseThe only problem that i still have is to "build or find this beans that create pie charts".
I'm investigating in findding some ressources, hope i will succeed in my search.Thanks
STF
(web development student) -
843833 Member Posts: 48,469 Green Ribbon
Please send the total code for me to creating charts dynamically.
Thank You.
-
843833 Member Posts: 48,469 Green Ribbon
Please send the total code for me to creating charts
dynamically.Thank You.
Please send me too! I need your help verty urgent!
I can't programming any kind of Chart , but I need to
create a dynamic Bar and Pie Chart now, and I can't
understand what rao_indts means completely.
so,please kindly to teach me how to create.
I will be very appreciate!Best Regards.
-
843833 Member Posts: 48,469 Green Ribbon
Dear rao_indts:
Would you please tell me what the "Sampledata.inc" should be wrote inside? and where the bean "Pie" come from? URGENT! thank you!Regards
This discussion has been closed.
How To Create Dynamic Pie Chart In Jsp
Source: https://community.oracle.com/tech/developers/discussion/1422797/dynamic-pie-charts
Posted by: delacruzlinto1997.blogspot.com

0 Response to "How To Create Dynamic Pie Chart In Jsp"
Post a Comment