<%@page import="ChartDirector.*" %> <% // //For demo purpose, we use hard coded data. In real life, the following data //could come from a database. // double[] revenue = {100,83,80,82,73,83,77,77,77,71}; String[] labels = {"390009","390010","390011","390012","390013","390014","390015","390016","390017","390018",}; //Create a XYChart object of size 450 x 200 pixels XYChart c = new XYChart(550, 320); //c.setBackground(0xffff80, 0x0, 1); c.setBackground(0xFFFFFF, 0x0, 1); //Add a title to the chart using Times Bold Italic font ChartDirector.TextBox title = c.addTitle("Assessment Summary", "arialbi.ttf", 11, 0x000000); title.setBackground(0xE1E1E1, -1, 1); //Set the plotarea at (60, 25) and of size 350 x 150 pixels c.setPlotArea(80, 45, 380, 180); //Add a blue (0x3333cc) bar chart layer using the given data. Set the bar border //to 1 pixel 3D style. c.addBarLayer(revenue, 0x3333cc, "Revenue").setBorderColor(-1, 1); //Set x axis labels using the given labels c.xAxis().setLabels(labels).setFontAngle(90); //Add a title to the y axis c.yAxis().setTitle("Score"); //Create the image and save it in a temporary location request.getSession().setAttribute("chart1", c.makeChart2(Chart.PNG)); //Create an image map for the chart String imageMap = c.getHTMLImageMap("CLICKLINE.jsp", "", "title='{xLabel} @ score {value|0}'"); %> <html> <body> <br> <table width="100%" border="0" cellspacing="1" cellpadding="2"> <tr> <td><div align="center"><img src="chart1.chart?no_cache=<%=Chart.getUniqueId()%>" border="0" usemap="#map1"> <map name="map1"> <%=imageMap%> </map> </div></td> </tr> </table> </body> </html>