[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IChart.PivotTable

PivotTable Property

PivotTable

Gets the IPivotTable associated with the chart.

For a PivotChart, this property returns the PivotTable that supplies the chart data.

Declaration
IPivotTable PivotTable { get; }
ReadOnly Property PivotTable As IPivotTable
Examples
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;