0
我有一個jsp頁面,其中包含兩個文本字段開始日期和結束日期。用戶將輸入開始日期和結束日期,然後我將在數據庫中查詢這些日期之間的數據。當我點擊提交時,它只會將其轉發到當前頁面,我會將日期作爲參數傳遞。到目前爲止這麼好,但問題是圖像jfreechart不刷新,除非我刷新瀏覽器本身。JFreeChart圖像不刷新在JSP
這是我的表格。
<form method="GET" action='monitor' name="check">
<table>
<tr>
<td>Start Date (dd/MM/yyyy format):</td>
<td><input type="text" name="startDate"
value="<%=startDate%>"></td>
</tr>
<tr>
<td>End Date (dd/MM/yyyy format):</td>
<td><input type="text" name="endDate" value="<%=endDate%>"></td>
</tr>
<tr>
<td><input type="submit" value="check"></td>
</tr>
</table>
</form>
<img src="lineChart.png" width="600" height="400" border="0" usemap="#chart" />
這裏是生成圖表
final File file1 = new File(getServletContext().getRealPath(".") + "/lineChart.png");
ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info);
我試着做writeChartAsPNG我的內嵌代碼,但它會覆蓋整個頁面。頁面還是應該是什麼樣子,
Start Date:
End Date:
[ VIEW ]
Monitor Data Chart
[ chart here ]
感謝我傳遞圖表參數中的開始日期和結束日期。喜歡這個。 http://stackoverflow.com/questions/13092729/adding-graph-chart-to-a-buffer/13093044#13093044 – jantox