How to add a PivotChart with Golang via C++
What is PivotChart
A pivot chart is a visual representation of the data in a pivot table. Pivot charts provide a way to summarize, analyze, explore, and present summary data. Here are some key features and aspects of pivot charts:
-
Dynamic Data Representation: Pivot charts automatically update to reflect changes in the pivot table. If you add or remove fields in the pivot table, the pivot chart updates accordingly.
-
Interactive: Pivot charts are interactive, allowing users to filter, sort, and drill down into data. This makes it easy to explore different aspects of the data set.
-
Flexible Layout: Users can change the layout of the pivot chart by dragging and dropping fields, which offers flexibility in how data is visualized.
-
Various Chart Types: Pivot charts can be created using various chart types such as bar charts, line charts, pie charts, and more, depending on the nature of the data and the insights you wish to gain.
-
Summarization: Pivot charts summarize large amounts of data and can show totals, averages, counts, or other summary statistics.
-
Filtering: They provide filtering capabilities, allowing you to display only the data that meets certain criteria.
Pivot charts are commonly used in business intelligence and data analysis to provide a clear and concise visual summary of complex data sets. They are a powerful tool for making data-driven decisions.
How to add a PivotChart using Aspose.Cells
Adding a Pivot Table
To create a pivot table using Aspose.Cells:
- Add some data to a worksheet cells using a
Cell
object’sPutValue
orSetValue
method. You can also use a template file already filled with data. The data will be used as the pivot table’s data source. - Add a pivot table to the worksheet by calling the
PivotTables
collection’sAdd
method (encapsulated in theWorksheet
object). - Access the new
PivotTable
object from thePivotTables
collection by passing its index. Use any of the pivot table objects encapsulated in thePivotTable
object to manage the table.
Code examples are given below.
Adding a Pivot Chart
To create a PivotChart using Aspose.Cells:
- Add a chart.
- Set the
PivotSource
of the chart to refer to an existing pivot table in the spreadsheet. - Set other attributes.