復制代碼 代碼如下:
 
<% 
String startTime = request.getParameter("startTime"); 
String endTime = request.getParameter("endTime"); 
String filter = request.getParameter("filter"); 
Charts charts = new Charts(); 
String start = startTime == null ? "2013-05-12" : startTime; 
String end = endTime == null ? "2013-11-01" : endTime; 
String filters = filter == null ? "eventtype" : filter; 
JFreeChart chart = charts 
.getPieChart(startTime, endTime, filter);//開始時間、結束時間、filter 
String filename = ServletUtilities.saveChartAsJPEG(chart, 800, 400, 
null, session); 
FileOutputStream fos_jpg = null; 
File file = new File(application.getRealPath("")+"/charts"); 
String path =request.getContextPath()+"/charts/NoData.jpg"; 
try { 
file.mkdirs(); 
fos_jpg = new FileOutputStream(file.getPath()+"/"+filename); 
ChartUtilities.writeChartAsJPEG(fos_jpg, 1.0f, chart, 800, 400, 
null); 
} catch (Exception e) { 
} finally { 
try { 
fos_jpg.close(); 
} catch (Exception e) { 
} 
} 
path = request.getContextPath()+"/charts/"+filename; 
%> 
<div> 
<img src="<%=path %>" width=800 height=400 border=0> 
</div> 
復制代碼 代碼如下:
 
extjs.chart.chart3D = function(nodeid,id){ 
var panel = new Ext.Panel({ 
border:false, 
fitToFrame: true,//很簡單的就一個Html標簽 
html: '<iframe src="/getColumnChart.jsp" frameborder="0" ></iframe>' 
}); 
return panel; 
} 
新聞熱點
疑難解答