-
Notifications
You must be signed in to change notification settings - Fork 1
/
simple.bas
34 lines (24 loc) · 868 Bytes
/
simple.bas
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
option explicit
sub main() ' {
dim rngData as range
set rngData = range( cells(1,1), cells(9,1) )
rngData.value = worksheetFunction.transpose(array("Data", 2.1 , 3.8 , 2.9 , -1.4 , -2.0 , 1.1 , 2.8, -0.4 ))
'
' Apparently, a waterfall chart does not allow to set the
' initial source range with .setSourceData, it seems that
' the source data needs to be selected when the chart is
' created:
'
rngData.select
dim shp as shape
set shp = activeSheet.shapes.addChart2(395, xlWaterfall)
dim cht as chart
set cht = shp.chart
with cht ' {
.hasTitle = true
.chartTitle.text = "Simple Waterfall Chart"
.export _
fileName := activeWorkbook.path & "\img\simple.png", _
filterName := "png"
end with ' }
end sub ' }