最近因为项目需要,学习了一下使用Apache POI绘制Excel折线图,话不多说,直接上代码。
<span style="white-space:pre"> </span>String filePath = "DTD.xlsx";
<span style="white-space:pre"> </span>FileInputStream inPut = new FileInputStream(filePath);
<span style="white-space:pre"> </span>
<span style="white-space:pre"> </span>Workbook workBook = new XSSFWorkbook(inPut);
<span style="white-space:pre"> </span>FileOutputStream outPut = new FileOutputStream(filePath);
<span style="white-space:pre"> </span>
<span style="white-space:pre"> </span>Sheet sheet = workBook.getSheetAt(0);
<span style="white-space:pre"> </span>
<span style="white-space:pre"> </span>//创建绘图区域
<span style="white-space:pr