TwoColorGradient Method
Applies To
ChartFillFormat object.
Description
Sets the specified fill to a two-color gradient.
Syntax
expression.TwoColorGradient(Style, Variant)
expression Required. An expression that returns a ChartFillFormat object.
Style Required Long. Specifies the gradient style. Can be one of the following MsoGradientStyle constants: msoGradientDiagonalDown, msoGradientDiagonalUp, msoGradientFromCenter, msoGradientFromCorner, msoGradientHorizontal, or msoGradientVertical.
Variant Required Long. Specifies the gradient variant. Can be a value from 1 through 4, corresponding to the four variants on the Gradient tab in the Fill Effects dialog box. If Style is msoGradientFromCenter, the Variant argument can only be either 1 or 2.
Example
This example sets the gradient, background color, and foreground color for the chart area fill on the chart.
With myChart.ChartArea.Fill
.Visible = True
.ForeColor.SchemeColor = 15
.BackColor.SchemeColor = 17
.TwoColorGradient msoGradientHorizontal, 1
End With