1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| @GetMapping("/layered-analysis") @ExportExcel( name = "分层分析-多图表", sheets = @Sheet(sheetName = "Layered Analysis"), charts = { @ExcelChart( title = "Revenue Analysis", enabled = true, type = ExcelChart.ChartType.LINE, xAxisField = "Month", yAxisFields = {"Sales"}, startRow = 0, startColumn = 8, endRow = 15, endColumn = 17, xAxisTitle = "Month", yAxisTitle = "Sales (USD)", showLegend = true, legendPosition = ExcelChart.LegendPosition.BOTTOM ), @ExcelChart( title = "Cost Analysis", enabled = true, type = ExcelChart.ChartType.AREA, xAxisField = "Month", yAxisFields = {"Cost"}, startRow = 17, startColumn = 8, endRow = 32, endColumn = 17, xAxisTitle = "Month", yAxisTitle = "Cost (USD)", showLegend = true, legendPosition = ExcelChart.LegendPosition.TOP ), @ExcelChart( title = "Profit Analysis", enabled = true, type = ExcelChart.ChartType.COLUMN, xAxisField = "Month", yAxisFields = {"Profit"}, startRow = 0, startColumn = 19, endRow = 15, endColumn = 27, xAxisTitle = "Month", yAxisTitle = "Profit (USD)", showLegend = true, legendPosition = ExcelChart.LegendPosition.RIGHT ) }) public List<ChartDataDTO> exportLayeredAnalysis(@RequestParam(defaultValue = "12") int months) { log.info("Exporting layered analysis with {} months of data", months); return testDataService.generateChartData(Math.min(months, 12)); }
|