-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathViewOptionsActions.vb
More file actions
124 lines (99 loc) · 4.12 KB
/
ViewOptionsActions.vb
File metadata and controls
124 lines (99 loc) · 4.12 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Imports Microsoft.VisualBasic
Imports System
Imports System.Drawing
Imports System.Globalization
Imports DevExpress.Spreadsheet
Imports DevExpress.Spreadsheet.Charts
Imports DevExpress.Spreadsheet.Drawings
Imports DevExpress.Utils
Namespace SpreadsheetChartAPIActions
Public NotInheritable Class ViewOptionsActions
Private Sub New()
End Sub
Private Shared Sub ShowAutomaticMarkers(ByVal workbook As IWorkbook)
' #Region "#ShowAutomaticMarkers"
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.Line, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")
' Display markers using automatic style.
chart.Series(0).Marker.Symbol = MarkerStyle.Auto
' Hide the legend.
chart.Legend.Visible = False
' #End Region ' #ShowAutomaticMarkers
End Sub
Private Shared Sub ShowCustomMarkers(ByVal workbook As IWorkbook)
' #Region "#ShowCustomMarkers"
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.Line, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")
' Display markers and specify the marker style.
chart.Series(0).Marker.Symbol = MarkerStyle.Circle
' Hide the legend.
chart.Legend.Visible = False
' #End Region ' #ShowCustomMarkers
End Sub
Private Shared Sub SetMarkerSize(ByVal workbook As IWorkbook)
' #Region "#SetMarkerSize"
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.Line, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")
' Display markers and specify the marker style and size.
chart.Series(0).Marker.Symbol = MarkerStyle.Circle
chart.Series(0).Marker.Size = 15
' Hide the legend.
chart.Legend.Visible = False
' #End Region ' #SetMarkerSize
End Sub
Private Shared Sub SmoothLines(ByVal workbook As IWorkbook)
' #Region "#SmoothLines"
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.LineMarker, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")
' Turn on curve smoothing.
chart.Series(0).Smooth = True
' Hide the legend.
chart.Legend.Visible = False
' #End Region ' #SmoothLines
End Sub
Private Shared Sub GapWidth(ByVal workbook As IWorkbook)
' #Region "#GapWidth"
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")
' Set the gap width between data series.
chart.Views(0).GapWidth = 33
' Hide the legend.
chart.Legend.Visible = False
' #End Region ' #GapWidth
End Sub
Private Shared Sub VaryColorsByPoint(ByVal workbook As IWorkbook)
' #Region "#VaryColorsByPoint"
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")
' Specify that each data point in the series has a different color.
chart.Views(0).VaryColors = True
' Hide the legend.
chart.Legend.Visible = False
' #End Region ' #VaryColorsByPoint
End Sub
End Class
End Namespace