如何使用 PivotOptions 管理数据透视图
Contents
[
Hide
]
什么是数据透视图
Excel中的数据透视图是从数据透视表中创建的数据的图形表示。它允许用户通过以图表形式汇总和显示信息来动态可视化和分析数据。数据透视图是交互式的,可以轻松修改以显示数据的不同视角,因此是Excel中数据分析和演示的强大工具。
如何使用数据透视表选项管理数据透视图
通过使用Aspose.Cells,您可以使用PivotOptions来管理数据透视图。
样本文件和代码: 样本文件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//How to manage PivotChart with PivotOptions | |
String path = ""; | |
Workbook book = new Workbook(path + "Sample.xlsx"); | |
Chart chart = book.getWorksheets().get(0).getCharts().get(0); | |
PivotOptions opt = chart.getPivotOptions(); | |
opt.setDropZoneFilter(false); //Hide ZoneFilter | |
//You can set more properties, try them! | |
//opt.setDropZoneCategories(false); //Hide ZoneCategories | |
//opt.setDropZoneData(false); //Hide ZoneData | |
//opt.setDropZoneSeries(false); //Hide ZoneSeries | |
//opt.setDropZonesVisible(false); //Hide All | |
book.save(path + "JavaOutput.xlsx"); | |
通过上面的示例代码,您可以查看以下效果的结果文件,如下图所示: