-
Notifications
You must be signed in to change notification settings - Fork 4
/
DataTableActions.cs
64 lines (54 loc) · 2.46 KB
/
DataTableActions.cs
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using DevExpress.Spreadsheet;
using DevExpress.Spreadsheet.Charts;
namespace SpreadsheetChartAPIActions
{
public static class DataTableActions
{
static void ShowDataTables(IWorkbook workbook)
{
#region #ShowDataTable
Worksheet worksheet = workbook.Worksheets["chartTask5"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location
Chart chart = worksheet.Charts.Add(ChartType.Line, worksheet["B2:C8"]);
chart.TopLeftCell = worksheet.Cells["F2"];
chart.BottomRightCell = worksheet.Cells["L14"];
DataTableOptions dataTableOptions = chart.DataTable;
dataTableOptions.Visible = true;
dataTableOptions.ShowLegendKeys = false;
#endregion #ShowDataTable
}
static void ChangeDataTableBorders(IWorkbook workbook)
{
#region #ChangeDataTableBorders
Worksheet worksheet = workbook.Worksheets["chartTask5"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location
Chart chart = worksheet.Charts.Add(ChartType.Line, worksheet["B2:C8"]);
chart.TopLeftCell = worksheet.Cells["F2"];
chart.BottomRightCell = worksheet.Cells["L14"];
DataTableOptions dataTableOptions = chart.DataTable;
dataTableOptions.Visible = true;
dataTableOptions.ShowLegendKeys = false;
dataTableOptions.ShowVerticalBorder = false;
dataTableOptions.ShowHorizontalBorder = false;
#endregion #ChangeDataTableBorders
}
static void ChangeDataTableFont(IWorkbook workbook)
{
#region #ChangeDataTableFont
Worksheet worksheet = workbook.Worksheets["chartTask5"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location
Chart chart = worksheet.Charts.Add(ChartType.Line, worksheet["B2:C8"]);
chart.TopLeftCell = worksheet.Cells["F2"];
chart.BottomRightCell = worksheet.Cells["L14"];
DataTableOptions dataTableOptions = chart.DataTable;
dataTableOptions.Visible = true;
dataTableOptions.ShowLegendKeys = false;
dataTableOptions.Font.Name = "Helvetica";
dataTableOptions.Font.Size = 12;
#endregion #ChangeDataTableFont
}
}
}