TwoColorGradient Method

Microsoft Graph Visual Basic

expression.TwoColorGradient(Style, Variant)

expression    Required. An expression that returns one of the objects in the Applies To list.

Style   Required MsoGradientStyle. Specifies the gradient style.

MsoGradientStyle can be one of these MsoGradientStyle constants.
msoGradientDiagonalDown
msoGradientDiagonalUp
msoGradientFromCenter
msoGradientFromCorner
msoGradientFromTitle
msoGradientHorizontal
msoGradientMixed
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