APPRISAL_REP41.jsp 2.01 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
<%@page import="ChartDirector.*" %>
<%
//The data for the bar chart
double[] data0 = {80,82,75,78,86,74,89,84,75,77,87,85,84};
double[] data1 = {83,85,81,83,90,79,80,85,80,79,88,87,86};

String[] labels = {"Leadership & Team Management", "Responsibility & Attitude", "Change & Crisis Management", "Job delegation & follow up", "Systematic Thinking","Personal Mastery","Develop Others","Human Relation & \n Cross function Management","Job Effectiveness","Job Quantity","Work ethic","Information & Analysis","Competency & Skill Development"};

//Create a XYChart object of size 300 x 240 pixels
XYChart c = new XYChart(600, 370);

//set background
c.setBackground(0xFFFFFF, 0x0, 1);

//Add a title to the chart using 10 pt Arial font
c.addTitle("         ASSESSMENT SUMMARY", "", 10).setBackground(0xE1E1E1, -1, 1);

//Set the plot area at (45, 25) and of size 239 x 180. Use two alternative
//background colors (0xffffc0 and 0xffffe0)
c.setPlotArea(200, 45, 350, 280).setBackground(0xFFFFFF, 0xF0F0F0);

//Add a legend box at (45, 20) using horizontal layout. Use 8 pt Arial font,
//with transparent background
c.addLegend(45, 20, false, "", 8).setBackground(Chart.Transparent);

//Add a title to the y-axis
c.yAxis().setTitle("SCORE");

//Reserve 20 pixels at the top of the y-axis for the legend box
c.yAxis().setTopMargin(20);

//Set the x axis labels
c.xAxis().setLabels(labels);

//Set Horizontal
c.swapXY();

//Add a multi-bar layer with 3 data sets
Layer layer = c.addBarLayer2(Chart.Side, 2);
layer.addDataSet(data0, 0x9900FF, "YEAR 2000");
layer.addDataSet(data1, 0xFFFF66, "YEAR 2001");

//output the chart
request.getSession().setAttribute("chart1", c.makeChart2(Chart.PNG));
%>
<html>
<body topmargin=0 leftmargin=5 rightmargin=0 marginwidth=5 marginheight=0>
<div style="font-size:18pt; font-family:verdana; font-weight:bold"> </div>
<br>
<br>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td><div align="center"><img src="chart1.chart?no_cache=<%=Chart.getUniqueId()%>"></div></td>
  </tr>
</table>
</body>
</html>