[]
Gets the IPivotTable associated with the chart.
For a PivotChart, this property returns the PivotTable that supplies the chart data.
IPivotTable PivotTable { get; }
ReadOnly Property PivotTable As IPivotTable
worksheet.Range["A1:B4"].Value = new object[,] {
{"Product", "Amount"},
{"Apple", 100},
{"Orange", 200},
{"Apple", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"]);
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 300, 200).Chart;
chart.SeriesCollection.Add(pivotTable.TableRange1);
IPivotTable linkedPivotTable = chart.PivotTable;