-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProtectionActions.cs
More file actions
32 lines (25 loc) · 990 Bytes
/
ProtectionActions.cs
File metadata and controls
32 lines (25 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using DevExpress.Spreadsheet;
using DevExpress.Spreadsheet.Charts;
using System;
namespace SpreadsheetChartAPIActions
{
public static class ProtectionActions
{
public static Action<Workbook> ProtectChartAction = ProtectChart;
static void ProtectChart(Workbook workbook)
{
#region #ProtectChart
Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location.
Chart 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;
#endregion #ProtectChart
}
}
}