Dim
array1, array3, array4, array5, array6
As
Variant
array1 = Array(0, 6, 6, 22, 22, 24)
array3 = Array(ymin, ymin, ymin, ymin, ymin, ymin)
array4 = Array(ymax, ymax, 0, 0, 0, 0)
array5 = Array(0, 0, ymax, ymax, 0, 0)
array6 = Array(0, 0, 0, 0, ymax, ymax)
With
myCht
.SeriesCollection.NewSeries
.SeriesCollection(1).XValues = Sheets(
"Messresultate T1"
).Range(
"D13:D100"
)
.SeriesCollection(1).ChartType = xlXYScatterLinesNoMarkers
.SeriesCollection(1).Format.Line.Transparency = 1
.SeriesCollection.NewSeries
.SeriesCollection(2).XValues = Sheets(
"Messresultate T1"
).Range(
"D13:D100"
)
.SeriesCollection(2).Values = Sheets(
"Messresultate T1"
).Range(
"I13:I100"
)
.SeriesCollection(2).AxisGroup = xlPrimary
.SeriesCollection(2).ChartType = xlXYScatterLinesNoMarkers
.SeriesCollection.NewSeries
.SeriesCollection(3).XValues = array1
.SeriesCollection(3).Values = array3
.SeriesCollection.NewSeries
.SeriesCollection(4).XValues = array1
.SeriesCollection(4).Values = array4
.SeriesCollection.NewSeries
.SeriesCollection(5).XValues = array1
.SeriesCollection(5).Values = array5
.SeriesCollection.NewSeries
.SeriesCollection(6).XValues = array1
.SeriesCollection(6).Values = array6
Dim
rowInt
As
Integer
For
rowInt = 3
To
6
.SeriesCollection(rowInt).AxisGroup = xlSecondary
.SeriesCollection(rowInt).ChartType = xlAreaStacked
Next
rowInt
.Axes(xlCategory, xlPrimary).MajorUnit = 4 / 24
.Axes(xlCategory, xlPrimary).TickLabels.NumberFormat =
"hh:mm"
.Axes(xlCategory, xlPrimary).MinimumScale = xmin / 24
.Axes(xlCategory, xlPrimary).MaximumScale = xmax / 24
.Axes(xlValue, xlPrimary).MinimumScale = ymin
.Axes(xlValue, xlPrimary).MaximumScale = ymax
.HasAxis(xlCategory, xlSecondary) =
True
.Axes(xlCategory, xlSecondary).CategoryType = xlTimeScale
.Axes(xlCategory, xlSecondary).AxisBetweenCategories =
False
.Axes(xlCategory, xlSecondary).Delete
.Axes(xlValue, xlSecondary).Delete
End
With