Hello,
I am trying to plot two graphs based off data I have. The problem I am encountering is that the first graph is plotting more than the four series I added. There are 14 series on the graph and I don't know why. The second graph came out as I wished. Any ideas? Thank you!
Code:Dim xaxis As Range Dim xaxisControl As Range Dim yaxis As Range Dim yaxisControl As Range Dim yaxistwo As Range Dim yaxisControltwo As Range Dim yaxisthree As Range Dim yaxisControlthree As Range 'freeze cycle 'Condensor temp Set yaxis = Sheets("FreezeData").Range("I:I") Set yaxisControl = Sheets("FreezeControl").Range("I:I") 'shelf temp Set yaxistwo = Sheets("FreezeData").Range("H:H") Set yaxisControltwo = Sheets("FreezeControl").Range("H:H") 'Pressure Set yaxisthree = Sheets("FreezeData").Range("L:L") Set yaxisControlthree = Sheets("FreezeControl").Range("L:L") Charts.Add ActiveChart.Name = "Freeze temps" With ActiveChart .ChartArea.AutoScaleFont = False .ChartType = xlLine .HasTitle = False .SeriesCollection.Add _ Source:=yaxis .SeriesCollection.Add _ Source:=yaxisControl .SeriesCollection.Add _ Source:=yaxistwo .SeriesCollection.Add _ Source:=yaxisControltwo .Axes(xlValue).CrossesAt = -100 .Axes(xlValue).HasTitle = True .Axes(xlCategory).HasTitle = True .Axes(xlValue).AxisTitle.Characters.Text = "Degrees C" .Axes(xlCategory).AxisTitle.Characters.Text = "Time" .HasTitle = True .ChartTitle.Characters.Text = "Freeze Cycle" .Axes(xlValue).MaximumScale = 100 .Axes(xlValue).MinimumScale = -100 .SeriesCollection(1).Name = "Condensor Temp" .SeriesCollection(2).Name = "Condensor Temp Control" .SeriesCollection(3).Name = "Shelf Temp" .SeriesCollection(4).Name = "Shelf Temp Control" .SeriesCollection(1).Format.Line.Weight = 2 .SeriesCollection(2).Format.Line.Weight = 2 .SeriesCollection(3).Format.Line.Weight = 2 .SeriesCollection(4).Format.Line.Weight = 2 End With 'customizes the second chart Charts.Add ActiveChart.Name = "Freeze pressure" With ActiveChart .ChartArea.AutoScaleFont = True .ChartType = xlLine .HasTitle = False .SeriesCollection.Add _ Source:=yaxisthree .SeriesCollection.Add _ Source:=yaxisControlthree .Axes(xlValue).CrossesAt = 400000 .Axes(xlValue).HasTitle = True .Axes(xlCategory).HasTitle = True .Axes(xlValue).AxisTitle.Characters.Text = "MTORR" .Axes(xlCategory).AxisTitle.Characters.Text = "Time" .HasTitle = True .ChartTitle.Characters.Text = "Freeze Cycle" .Axes(xlValue).MinimumScale = 400000 .SeriesCollection(1).Name = "Pressure" .SeriesCollection(2).Name = "Pressure Control" .SeriesCollection(1).Format.Line.Weight = 2 .SeriesCollection(2).Format.Line.Weight = 2 End With


Reply With Quote
