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
Similar Messages
-
How to Create a PIE chart with PPR
Hi All,
Can you please help me to achieve the below.
Can we create any Pie Chart. In Pie chart If we have 5 Parts when I click on any part of Pie chart It should display my new region below to the chart in the same page Page)?
Regards,
Mahendra.Hi
For Creation of pie- chart Please refer to dev guide under the section pie-graph
and as per ur req use the normal ppr for diff sections of pie-graph
regards
SasiKasyap . -
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 from a pop-up menu in Numbers?
I would like to be able to select a persons name from the Pop-up menu in the E column to chose who has bought an item. I would then like to create a pie chart showing how much money each person has spent on buying the items and have this update automatically. I have no idea how I would go about doing this. Any help would be greatly appreciated.
ThanksCosts per person, with "Ali & Baker" as a separate entity (since no provision for separating costs)
The formula is this:
=SUMIFS($Cost, $Who Bought it?, "="&$Who Bought it?, $Bought?, "=TRUE")
The reasoning is:
Sum all Costs, if the following conditions are true:
$Who Bought it?, "="&$Who Bought it?
Group items in the 'Who Bought it? column that match the item in the same row as the formula.
$Bought?, "=TRUE"
Only include items that have actually been bought.
Screenshot
I have highlighted the selected cell in red.
The coloured columns show which ones are relevant to the formula.
To create the totals, I added Footer rows to the table.
You could make a separate table if you prefer.
To create the pie chart, I selected just the costs in the footer rows, and clicked on Charts. -
Create Multiple Pie Charts with Drill Down capability(foreach in mainreport
Hello All,
i need to create a report with 4 pie charts, which should have drilldown capability. i tried to do that, and i can do only for two charts. i need for the rest 2 also.
Please help.
ThanksSee this thread:
BO Design studio Chart Component issue ...!! | SCN
If Chart is bound to DS_1 and On Select event of chart is as below:
DS_2.setFilter(dimension, CHART_1.getSelectedMember(dimension));"
This works when you click a value on one chart it will select another.
I haven't tried it with hierarchies. -
Please help with sample windows form C#.Net Example
Hi Goutam,
Please refer to the following link with examples: http://www.codeproject.com/Questions/234865/create-real-time-chart
Hope this helps you!
Regards,
Mitch! -
How to create legislative seating chart with illustrator?
What is procedure to create a legislative seating chart with illustrator. Examples of such charts are as follows:
https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/11th_Parliament_National_Assembl y_Kenya.svg/360px-11th_Parliament_National_Assembly_Kenya.svg.png
https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/14thNationalAssemblyOfPakistan.s vg/512px-14thNationalAssemblyOfPakistan.svg.png
https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/House_of_the_People%2C_India%2C_ 2012.svg/360px-House_of_the_People%2C_India%2C_2012.svg.png
Please help me. Would be thanful if someone tells me.
HELP!One thing to note before you can add a stroke to the circles after the compound path has been released you will have to once again go to object>expand, I do not know why but it is necessary.
Some screen shots to help you along.
Also you actually need to make it seven concentric dividers not eight.
In this screen shot one of the stroke circles is selected so you can see in the stroke panel the center option for the alignment is active that is the one ou need of course.
Also I am sorry I forgot to spell check in my original posting. So you will probably have to use your imagination…quite a lot. -
Re-creating a pie chart with the pie graph tool...
Hi,
Hope you're well.
I've created a pie graph using the pie graph tool.
I'd like to create another one of the same size but when I enter in the exact same dimensions when it asks you to give the dimesions you want for the circle, the circle never matches what the measurements of the circle are that I want to copy.
Just to illustrate in case its not clear, the existing pie graph circle size is something like 500x500 px but when I type that in when I want to draw another one it does not match the size of the original.
Anyone know what might be going on?
Thanks so much for your help.500x500 px but when I type that in when I want to draw another one it does not match the size of the original.
shouldnt happen if all is set correctly,
i presume you select the pie g tool and click on artboard then insert the dimensions in the pop up dialogue... if all is set correctly it could be (eg) a thicker stroke or a style applied to to the original... also make sure everything is set to px....
G -
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 -
Pie chart with Quartz 2D,
Hi!
I'm trying to create a pie chart with Quartz 2D, can't find out how to do it, maybe anyone can point me in the right direction?
Thanks really much for your help!I'm going to start the same task, I'm just reading the quartz 2d guide, but I'm thinking you can draw semicircles paths transforming the % of your data in angles, then creating paths from the end of the semicircle to the center of the circunference. sounds good for you? any comments? how was your approach?
-
How to create the timeline chart in SSRS 2008
Hello Everyone!!
How to create basic timeline chart with x asix as month and show project start date as marker on this in ssrs reports
Which type of chart i should use and any sample link?
Something like in below link
Timeline
imageHi SonikaJ,
After testing the issue in my local environment, we can enable the Scalar axis option to display a set of axis values on a continuous scale and reset the “Interval” property of the X-Axis. For more details, please see the following steps:
Drag a Column Chart to design surface, insert corresponding fields.
Right click on the Horizontal Axis and open the “Category Axis Properties” window.
Check the “Scalar axis” option, set the “Interval type” to “Months” and set the “Interval” to 1 for example.
Right click on the Vertical Axis and uncheck “Show Axis” option to hide the Y-Axis.
Right-click the series columns to select “Show Data Labels”, then right-click on the Label and select Series Label Properties.
In the Expression dialog box, modify the expression to anything you like.
To adjust the width simply select the appropriate series and go to the properties pane and drill down into the Custom Attributes and find the PointWidth. Then set the value to 0.1 for example.
If there are any other questions, please feel free to let me know.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Pie chart with resizable slice ?
Hello All,
Is it possible to create a pie chart with re-sizable slice.. ie user should be able to decrease and increase the area of any slice by just using mouse drag. If I increase area of any particular slice, other adjacent slice should automatically get reduced. Please provide me some pointers on this .
Regards,
DharmendraHi Deepak,
I had time dimension in the RPD.
I have stacked bar chart with same time dim like year & month in the report. when I go to legand and set navigation it is working fine. But not with pie chart.
I am not not sure what is the problem. When I click on Pie chart it is not navigating to the target report. Can it be any other issues..??? -
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 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 -
How do i Create charts using JSP/Servlet & Database
I have to create charts which shows the graph of stock exchange.
i have a database that keeps the data for creating charts.
But i did not know how to create charts using jsp-servlet.
Any Example might help me to go forward.
Any help will be really appreciated.
Please Advice me.JFreeChart - You can generate the charts then convert them to image formats (PNG and JPEG) all using the JFreeChart API
http://www.jfree.org/jfreechart/
Maybe you are looking for
-
Is it possible for Express to broadcast signal in hotel room to iPad?
Hello: I would like to know if it is possible to configure an Airport Express so that it is connected to an ethernet port in a hotel room and have the express broadcast a wireless signal to my iPad? This will be my configuration: 1. One airport expre
-
To perform database update in a module with AT EXIT-COMMAND addition
Dear All, I have a function code 'EXIT' with function type 'E'. When this function code is triggered, my screen should close. In the module that handles this function code (defined with AT EXIT-COMMAND addition), I will prompt the user whether he/she
-
HI guys after seeking advice from apple over the phone as to the best way to connect my macbook to my TV they advised I get a Monster ITV Link cable with a scart adapter. The picture displays by using this but in black and white, is there anything I
-
HI EVERY BODY MY CLIENT HAVE AN REQUIREMENT WHILE DOING TRANSFER POSTING FORM ONE STORAGE LOCATION TO ANOTHER. IN REPORT CLIENT WANT TO SEE FROM WHICH STORAGE LOCATION MATERIAL HAS COME. REGARDS JAYAKER
-
What is that monochrome icon again?
Folks, I know this is trivial but there's a somewhat new monochrome GNOME icon that many third-party icon sets seem to miss - it's for a USB device that is larger than 8.0 Gib so it does not get a pendrive monochrome icon in Nautilus but not big enou