Попытка изменить строку моих полных серий sourcedata rangey3.
Я пытался использовать:
.Format.Line.ForeColor.RGB = RGB(56, 182, 75)
.MarkerBackgroundColor = RGB(56, 182, 75)
безрезультатно, но это работает для прогнозируемых значений.
Мой код:
ActiveSheet.Shapes.AddChart2(332, xlLineMarkers).Select
With ActiveChart
.SetSourceData Source:=rangey3
' Must have this as we will be using different series inside of this chart from here on out
.FullSeriesCollection(1).Name = "Demand"
' This is the first series of the full series collection
.SeriesCollection(1).XValues = rangex
.SeriesCollection.NewSeries
' Creates legend at the bottom of the chart
.SetElement (msoElementLegendBottom)
' Deletes the chart title as per the illustration in Assignment 2's illustration screenshot
.ChartTitle.Delete
' Creates the line Demand (Forecast)
With .SeriesCollection(2)
.Name = "Demand (Forecast)"
.Values = rangey2
.Format.Line.Visible = msoTrue
' Makes the forecast line distinguishable by dotting it
.Format.Line.DashStyle = msoLineSysDot
.Format.Line.ForeColor.RGB = RGB(56, 182, 75)
.MarkerBackgroundColor = RGB(56, 182, 75)
End With