您可以做的是将所有系列线颜色更改为浅色,除了一种。那个你颜色深或亮,即红色。然后您可以重复该过程(将宏分配给图表上/附近的按钮)以依次突出显示每个系列。
Sub CycleSeriesColors()
Dim seriesCount As Integer, i As Integer, smod
Static s '"Remember" what series we are on between calls.
ActiveSheet.ChartObjects("Chart 1").Activate
' ActiveChart.PlotArea.Select
seriesCount = ActiveChart.SeriesCollection.Count
s = s + 1
smod = s Mod (seriesCount + 1)
' ActiveChart.ChartArea.Select
If Not smod = 0 Then
With ActiveChart.SeriesCollection(smod).Format.Line
.Visible = msoTrue
.Visible = msoTrue
.ForeColor.RGB = RGB(192, 0, 0)
.Transparency = 0
End With
For i = 1 To seriesCount
If Not i = smod Then 'the series is to backgrounded
With ActiveChart.SeriesCollection(i).Format.Line
.Visible = msoTrue
.Visible = msoTrue
.ForeColor.RGB = RGB(240, 240, 240)
.Transparency = 0.85
End With
End If
Next i
Else
Randomize
For i = 1 To seriesCount
With ActiveChart.SeriesCollection(i).Format.Line
.Visible = msoTrue
.Visible = msoTrue
.ForeColor.RGB = RGB(((i * i) ^ 0.6 * 3), ((i * i) ^ 0.6 * 8), ((i * i) ^ 0.6 * 12))
.Transparency = 0
End With
Next i
End If
End Sub