[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IPivotOptions.ShowLegendFieldButtons

ShowLegendFieldButtons Property

ShowLegendFieldButtons

Gets or sets whether legend field buttons are displayed on a PivotChart.

Use this property to determine the current visibility of legend field buttons for a PivotChart's PivotOptions settings.

Declaration
bool ShowLegendFieldButtons { get; set; }
Property ShowLegendFieldButtons As Boolean
Examples
worksheet.Range["A1:C4"].Value = new object[,] {
    {"Product", "Region", "Amount"},
    {"Apple", "East", 100},
    {"Apple", "West", 200},
    {"Pear", "East", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
pivotTable.PivotFields["Product"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Region"].Orientation = PivotFieldOrientation.ColumnField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IChart chart = worksheet.Shapes.AddChartInPixel(ChartType.ColumnClustered, 0, 120, 360, 240).Chart;
chart.SetSourceData(pivotTable.TableRange1);
chart.PivotOptions.ShowLegendFieldButtons = false;
bool showLegendFieldButtons = chart.PivotOptions.ShowLegendFieldButtons;