| 1234567891011121314151617181920212223242526272829303132 |
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ page import="com.yw.core.jfreechart.service.Chart"%>
- <%@ page import="java.io.InputStream"%>
- <%@ page import="com.yw.core.jfreechart.model.DisplayModel"%>
- <%@ page import = "java.io.PrintWriter" %>
- <%
- String clz = (String)request.getAttribute("classService");
- Class obj = Class.forName(clz);
- Chart chart = (Chart)obj.newInstance();
- DisplayModel dm=chart.getChart(session,new PrintWriter(out));
- String pdfFile = dm.getFileName().replace("png","pdf");
- String graphURL = request.getContextPath() + "/jchart.do?filename=" + dm.getFileName();
- %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Insert title here</title>
- <script type="text/javascript">
- $(document).ready(function(){
- $("#displayPDF").bind("click",function(){
- window.open("chart/pdf/<%=pdfFile%>");
- });
- });
- </script>
- </head>
- <body>
- <div>
- <div><img src="<%=graphURL%>" width="500" height="300" border="0" usemap="<%=dm.getFileName()%>"></div>
- </div>
- </body>
- </html>
|