我的代码遇到了问题,因为当绘制第二个系列时,它具有系列1和2的sume值。 这是我的代码:
Dim Chart2 As ChartObject
Set Chart2 = ActiveSheet.ChartObjects.Add(Left:=10, Width:=1380, Top:=450, Height:=380)
Chart2.Chart.ChartType = xlLineStacked
Chart2.Chart.SeriesCollection.NewSeries
Chart2.Chart.SeriesCollection(1).Name = "Hours"
Chart2.Chart.SeriesCollection(1).XValues = ActiveSheet.Range("B93:S93)
Chart2.Chart.SeriesCollection(1).Values = ActiveSheet.Range("B95:W95)
Chart2.Chart.SeriesCollection.NewSeries
Chart2.Chart.SeriesCollection(2).Name = "CdT"
Chart2.Chart.SeriesCollection(2).XValues = ActiveSheet.Range("B93:S93)
Chart2.Chart.SeriesCollection(2).Values = ActiveSheet.Range("B99:W99)
提前谢谢你