Rajkumar
3d pie chart
4 Answer(s)      6 years and 11 months ago
Posted in : Java3D
Advertisement
View Answers

September 22, 2008 at 5:46 PM


Hi friend,



I saw your given code. I think your code is correct please chart library.


DefaultPieDataset pieDataset = new DefaultPieDataset();
pieDataset.setValue("One", new Integer(10));
pieDataset.setValue("Two", new Integer(20));
pieDataset.setValue("Three", new Integer(30));
pieDataset.setValue("Four", new Integer(10));
pieDataset.setValue("Five", new Integer(20));
pieDataset.setValue("Six", new Integer(10));
JFreeChart chart = ChartFactory.createPieChart3D
("3D Pie Chart", pieDataset, true,true,true);
PiePlot3D p=(PiePlot3D)chart.getPlot();
p.setForegroundAlpha(0.5f);
ChartFrame frame1=new ChartFrame("3D Pie Chart",chart);



--------------------------------------------------


Read for more information.


http://www.roseindia.net/chartgraphs/


Thanks.

Amardeep


September 22, 2008 at 5:57 PM


Hi friend

Check are u avail JFreeChart library or not?

If not go for jfreechart.org there download.

Here i am using swiftchart, for this we need a class File named "swiftchart_app", and it should be placed inside folder "swiftchart"
if u need this class file just send ur mailid to my mail: rajanikant.misra@gmail.com


<%@ page session="false"%>
<%@ page contentType="image/jpeg" import="com.sun.image.codec.jpeg.*" %>
<%@ page import="swiftchart.swiftchart_app" %>
<html>
<body>
<% swiftchart.swiftchart_app mychart= new swiftchart.swiftchart_app(400,300);
mychart.setParam("chart_type","line");

mychart.setParam("chart_type" ,"pie3d");
mychart.setParam("depth3D" ,"300");
mychart.setParam("applet_bg" ,"EEEEEE");
mychart.setParam("chart_bg" ,"FFFFFF");
mychart.setParam("title_text" ,"3D pie chart with extra 3D depth");
mychart.setParam("title_font_color" ,"000000");
mychart.setParam("title_font_size" ,"18");
mychart.setParam("title_font_type" ,"Arial");
mychart.setParam("title_font_style" ,"Plain");
mychart.setParam("x_axis_font_color" ,"000000");
mychart.setParam("x_axis_font_size" ,"12");
mychart.setParam("x_axis_font_type" ,"Arial");
mychart.setParam("x_axis_font_style" ,"Plain");
mychart.setParam("x_axis_font_orientation" ,"HORIZONTAL");
mychart.setParam("x_axis_value_display" ,"N");
mychart.setParam("legend_position" ,"LEFT");
mychart.setParam("legend_font_color" ,"000000");
mychart.setParam("legend_font_size" ,"16");
mychart.setParam("legend_font_type" ,"Courier");
mychart.setParam("legend_font_style" ,"Italic");
mychart.setParam("data_value" ,"OUTSIDE");
mychart.setParam("data_value_font_size" ,"12");
mychart.setParam("data_value_pct" ,"Y");
mychart.setParam("data_value_font_type" ,"Arial");
mychart.setParam("data_value_font_style" ,"BOLD");
mychart.setParam("x_value" ,"Jan");
mychart.setParam("s1_value" ,"23.5");
mychart.setParam("s1_label" ,"Apples");
mychart.setParam("s1_color" ,"3366CC");
mychart.setParam("s2_value" ,"8.8");
mychart.setParam("s2_label" ,"Plums");
mychart.setParam("s2_color" ,"3399FF");
mychart.setParam("s3_value" ,"20.4");
mychart.setParam("s3_label" ,"Pears");
mychart.setParam("s3_color" ,"66CCFF");
mychart.setParam("s4_value" ,"12.2");
mychart.setParam("s4_label" ,"Grapes");
mychart.setParam("s4_color" ,"99CCFF");

ServletOutputStream sos = response.getOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
encoder.encode(mychart.getChart()); %>
</body>
</html>

Thanks'
Rajanikant


September 22, 2008 at 6:07 PM


Thanks Amerdeep that code is working fine


September 22, 2008 at 6:08 PM


Dear Rajni i think we need some library for that graph









Related Tutorials/Questions & Answers:
3d pie chart - Java3D
3d pie chart  Dear Sir, i want to create 3d pie chart using jsp, i have some code for 2d pie chart in jsp and 3d pie chart in applet. for 2d pie... for creating 3d pie chart but its showing error. i used following code
3D Pie Chart
3D Pie Chart       In this section we are providing you an example to create a 3D Pie Chart. Description of Program :    For creating a 3D Pie Chart we use
Advertisements
pie chart
pie chart  how to create pie chart using struts2
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
pie chart
pie chart  hii..how to display data from database and show it in piechart according to different data that is present in database..plzz help
Create pie chart
Create pie chart  hi............. In my project i want to create a pie chart to display the result. i require a very simple code in java swings were i can edit the code and put my values... so plz help me
Pie chart on jsp
Pie chart on jsp  how can i create a pie chart on a jsp page using... that creates a pie chart using JFreechart api and takes the value from..."); dataset.executeQuery(query); JFreeChart chart = ChartFactory.createPieChart
How to draw pie chart in J2ME
How to draw pie chart in J2ME  Hi, I'm developing a program using J2ME and I want to draw a pie chart but it seems J2ME language hasn't available chart component like JFreeChart in Java! could any one help me how can I draw a pie
Pie Chart
Pie Chart       In this section we are providing you an example to create a Pie Chart. Description of Example   For creating a Pie Chart we use PieDataset
Pie Chart - Java Beginners
Pie Chart  How to Draw a Pie chart using graphics in java  Hi friend, I am going to post complete running code. import java.awt.... ChartPanel(values, names, "Simple Pie Chart")); WindowListener wndCloser = new
how to create 3d chart in dojox charting - XML
how to create 3d chart in dojox charting  Please provide some example for 3d charting in dojox chart
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
Draw Pie Chart
Draw Pie Chart       This Java Pie Chart example is going to show you how to draw Pie Charts in Java. This Java Pie Chart example is drawing a pie chart to show
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
3D Bar Chart
3D Bar Chart       In this section we are providing you an example to create a 3D Bar Chart. Description of Program  For creating a 3D Bar chart we use the object
PHP GD Pie Chart
, 200, 100, 0, 45, $darknavy, IMG_ARC_PIE); imagefilledarc($image, 150, $i, 200, 100, 45, 75 , $darkgray, IMG_ARC_PIE); imagefilledarc($image, 150, $i, 200, 100, 75, 360 , $darkred, IMG_ARC_PIE); } imagefilledarc($image, 150
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
pie chart flex and sum from hql request
pie chart flex and sum from hql request  hi, i work with flex and j2ee project.i have to make a function wich return list of value: print("public... to show the result in the pie shart but the probleme is i don't have a field
Create a pie chart in jsp page using JFreeChart
Create a pie chart in jsp page using JFreeChart... to create a pie chart in jsp page using JFreeChart. Code given below creates a simple pie chart for given values. In the code given below we have extended class
Create Pie Chart using database values
Create Pie Chart using database values Java provides JFreeChart library which... a pie chart by retrieving the values from the database. Here is the code...*; import org.jfree.data.jdbc.JDBCPieDataset; public class Chart { public static
Stacked 3d Bar Chart Example using JFreeChart
Stacked 3d Bar Chart Example using JFreeChart... a Stacked 3d bar chart using JFreeChart. Bar chart will represent the score...;    new StackedBarChart3D("Stacked 3D Bar Chart"
Create a 3D bar chart in JSP page using JFreeChart
Create a 3D bar chart in JSP page using JFreeChart... to create a 3D bar chart in jsp page using JFreeChart. Code given below creates a bar chart of scores of two teams in matches. In the code given below
Create multiple pie chart in single frame using JFreeChart
Create multiple pie chart in single frame using JFreeChart... you how to create a multiple pie charts in a single frame in jsp page using JFreeChart. Code given below creates a simple pie charts for given values
3D PASSWORD
3D PASSWORD  HI i would like to know abt where the 3d password in india used and also few info about the 3d password pls rply some1 as soon as possible
java or 3d
java or 3d  can we use of 3d in core java? if yes pls tell me a demo example of 3d java. thanks...   Have a look at the following link: http://www.roseindia.net/answers/viewqa/Java3D/8406-java.html
Chart & Graphs Tutorials in Java
Chart Example In this section we are providing you an example to create a Pie Chart.    3D Pie Chart Example In this section we are providing you an example to create a 3D Pie Chart.   Area Chart Example
Difference between 3d and 4d
Difference between 3d and 4d  what is the difference between 3d and 4d
3D JButton in java?
3D JButton in java?  how we can create 3D button in java. thanks
java 3d code - Java3D
java 3d code  can u please send source code, how to clear canvas3d in java 3d. In my project if i click on clear button in awt frame then canvas must be clear, please send code
How to make a 3D text, make a 3D text, a 3D text
How to make a 3D text       The 3d text can be made by the photoshop, this example... and use these settings. This is your 3D text. Final Result
Java 3D - Java3D
Java 3D  Hi can u tell me how can i write the code to develop the 3Dimension figure in java  hi Sivaraman, Create Java Applet. import java.applet.*; import java.awt.*; import java.awt.event.