|
pie1.a.java |
|
1 package sutut1;
2
3 import javax.servlet.*;
4 import javax.servlet.http.*;
5 import java.io.*;
6 import java.util.*;
7
8 import us.oh.state.common.utility.*;
9
10 public class pie1 extends HttpServlet {
11
12 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
13 response.setContentType("application/pdf");
14 PdfChart page = new PdfChart(response.getOutputStream());
15 page.setTextColor(0x0);
16 page.setFont(page.BOLD, 24);
17 page.println("Tutorial - Pie 1");
18 page.setFont(page.NORMAL, 12);
19 page.println(new Date().toString());
20 PdfPieChart pie = new PdfPieChart();
21 PieSlice [] jvm = new PieSlice [] {
22 new PieSlice("LTH", 3.4, 0xff0000, 0xffaaaa),
23 new PieSlice("RAL", 2.9, 0x00ff00, 0xaaffaa),
24 new PieSlice("JCD", 7.5, 0x0000ff, 0xaaaaff),
25 new PieSlice("GDW", 4.1, 0xff00ff, 0xffaaff),
26 new PieSlice("RBB", 2.4, 0x00ffff, 0xaaffff)
27 };
28 pie.drawMain(page, jvm, 1.5, 5.0, 5.0, 5.0, 0.0);
29 page.close();
30 }
31
32 }
|
pie1.a.java |
|