-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathProtection.cs
More file actions
34 lines (28 loc) · 1011 Bytes
/
Protection.cs
File metadata and controls
34 lines (28 loc) · 1011 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
33
34
using DevExpress.Spreadsheet;
using DevExpress.Spreadsheet.Charts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SpreadsheetChartAPIActions
{
public static class Protection
{
static void ProtectChart(IWorkbook 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
}
}
}