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
| 'Chart creation
Charts.Add
ActiveChart.Location where:=xlLocationAsNewSheet
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:=Sheets("PARAM").Range("AA" & 1 & ":AD" & n), PlotBy _
:=xlColumns
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(4).Delete
'Humidity curve
ActiveChart.SeriesCollection(1).Name = "Humidity"
'VHP Conc curve
ActiveChart.SeriesCollection(2).Name = "VHP Conc."
'Max allowable VHP curve
ActiveChart.SeriesCollection(3).Name = "Max allowable VHP"
'border
ActiveChart.ChartArea.Border.Color = RGB(255, 255, 255)
'backcolor
ActiveChart.PlotArea.Interior.Color = RGB(255, 255, 255)
'legend
ActiveChart.Legend.Position = xlLegendPositionBottom
ActiveChart.Legend.Border.Color = RGB(255, 255, 255)
ActiveChart.SeriesCollection(1).AxisGroup = xlSecondary
ActiveChart.SeriesCollection(1).MarkerStyle = None
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
.Color = RGB(0, 0, 255)
End With
ActiveChart.SeriesCollection(2).MarkerStyle = None
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
.Color = RGB(255, 0, 0)
End With
ActiveChart.SeriesCollection(3).MarkerStyle = None
ActiveChart.SeriesCollection(3).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
.Color = RGB(51, 153, 51)
End With
If Sheets("PARAM").CheckBox1.Value = True Then
ActiveChart.SeriesCollection(1).MarkerStyle = xlMarkerStyleCircle
ActiveChart.SeriesCollection(1).MarkerBackgroundColor = RGB(0, 0, 255)
ActiveChart.SeriesCollection(1).MarkerSize = 4
ActiveChart.SeriesCollection(2).MarkerStyle = xlMarkerStyleSquare
ActiveChart.SeriesCollection(2).MarkerBackgroundColor = RGB(255, 0, 0)
ActiveChart.SeriesCollection(2).MarkerSize = 4
ActiveChart.SeriesCollection(3).MarkerStyle = xlMarkerStyleTriangle
ActiveChart.SeriesCollection(3).MarkerBackgroundColor = RGB(51, 153, 51)
ActiveChart.SeriesCollection(3).MarkerSize = 4
Else: GoTo Y
End If
Y: With ActiveChart
.HasTitle = True
.ChartTitle.Font.Bold = True
.ChartTitle.Font.Size = 12
.ChartTitle.Characters.Text = Sheets("PARAM").[L1] & Chr(13) & "Min. Chamber Temperature: " & Sheets("PARAM").[A22] & "°C"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Time (min)"
.Axes(xlCategory, xlPrimary).AxisTitle.Font.Size = 10
.Axes(xlCategory, xlPrimary).AxisTitle.Font.Bold = True
With .Axes(xlCategory)
.MinimumScale = 0
.MaximumScale = Sheets("PARAM").[A4] + Sheets("PARAM").[A8] + Sheets("PARAM").[A12] + Sheets("PARAM").[A16]
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlCustom
.CrossesAt = 0
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "VHP Concentration (mg/L)"
.Axes(xlValue, xlPrimary).AxisTitle.Font.Size = 10
.Axes(xlValue, xlPrimary).AxisTitle.Font.Bold = True
.Axes(xlValue, xlSecondary).HasTitle = True
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text = "Relative Humidity (%)."
.Axes(xlValue, xlSecondary).AxisTitle.Orientation = 90
.Axes(xlValue, xlSecondary).AxisTitle.Font.Size = 10
.Axes(xlValue, xlSecondary).AxisTitle.Font.Bold = True
End With
If Sheets("PARAM").DispT.Value = False Then
ActiveChart.ChartTitle.Characters.Text = Sheets("PARAM").[L1]
End If |
Partager