|
|
|
@ -360,8 +360,7 @@ public class ExcelKit {
|
|
|
|
|
public static List<List<String>> getChartData(String docPath, int chartNumber, int skipRowCount) throws IOException, InvalidFormatException, InterruptedException, DocumentException {
|
|
|
|
|
List<List<String>> data = readChart(docPath, chartNumber);
|
|
|
|
|
//需要跳过前skipRowCount行,先要判断一下是不是够跳的,不够跳的直接输出错误
|
|
|
|
|
if (data.size() < skipRowCount) {
|
|
|
|
|
System.out.println("skipRowCount is too big, please check your data.");
|
|
|
|
|
if (data==null ||data.size() < skipRowCount) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
//截取部分数据返回
|
|
|
|
@ -562,9 +561,15 @@ public class ExcelKit {
|
|
|
|
|
// 处理barChart或lineChart节点
|
|
|
|
|
//System.out.println("找到图表类型:" + child.getName());
|
|
|
|
|
String type = child.getName();
|
|
|
|
|
Element q = root.element("chart").element("plotArea").element(type)
|
|
|
|
|
.element("ser").element("cat").element("numRef");
|
|
|
|
|
xList = q.element("numCache").elements("pt");
|
|
|
|
|
Element q = root.element("chart");
|
|
|
|
|
q = q.element("plotArea");
|
|
|
|
|
q = q.element(type);
|
|
|
|
|
q = q.element("ser");
|
|
|
|
|
q = q.element("cat");
|
|
|
|
|
if (q == null) return null;
|
|
|
|
|
q = q.element("numRef");
|
|
|
|
|
q = q.element("numCache");
|
|
|
|
|
xList = q.elements("pt");
|
|
|
|
|
|
|
|
|
|
List<Object> listObject = new ArrayList<>();
|
|
|
|
|
///c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:val/c:numRef/c:numCache
|
|
|
|
|