The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

ChartOptions.Protection Property

Gets or sets the chart protection.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

ChartProtection Protection { get; set; }
Property Protection As ChartProtection
ChartProtection Protection { get; set; }
Property Protection As ChartProtection

Property Value

Type Description
ChartProtection

A ChartProtection enumeration value containing protection options.

Property Value

Type Description
ChartProtection

A ChartProtection enumeration value containing protection options.

Remarks

Use the Protection property to prevent the chart from being modified by the user. Currently, members of the ChartProtection enumeration do not influence the chart protection. Whatever value you select, the chart will be completely locked, so that an end-user cannot select or modify it through the user interface. However, you can access the protected chart in code and apply desired changes programmatically.

Examples

The following example demonstrates how to create a clustered column chart and apply chart protection using the ChartOptions.Protection property.

Dim worksheet As Worksheet = workbook.Worksheets("chartTask3")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B2:D4"))
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")

' Specify the chart style.
chart.Style = ChartStyle.ColorDark

' Apply the chart protection.
chart.Options.Protection = ChartProtection.All
See Also