expression.SetPatterned(patternType, Color, BackColor)
expression Required. An expression that returns a ChInterior object.
patternType Required ChartPatternTypeEnum . The pattern style.
ChartPatternTypeEnum can be one of these ChartPatternTypeEnum constants. |
chPattern10Percent |
chPattern20Percent |
chPattern25Percent |
chPattern30Percent |
chPattern40Percent |
chPattern50Percent |
chPattern5Percent |
chPattern60Percent |
chPattern70Percent |
chPattern75Percent |
chPattern80Percent |
chPattern90Percent |
chPatternDarkDownwardDiagonal |
chPatternDarkHorizontal |
chPatternDarkUpwardDiagonal |
chPatternDarkVertical |
chPatternDashedDownwardDiagonal |
chPatternDashedHorizontal |
chPatternDashedUpwardDiagonal |
chPatternDashedVertical |
chPatternDiagonalBrick |
chPatternDivot |
chPatternDottedDiamond |
chPatternDottedGrid |
chPatternHorizontalBrick |
chPatternLargeCheckerBoard |
chPatternLargeConfetti |
chPatternLargeGrid |
chPatternLightDownwardDiagonal |
chPatternLightHorizontal |
chPatternLightUpwardDiagonal |
chPatternLightVertical |
chPatternNarrowHorizontal |
chPatternNarrowVertical |
chPatternOutlinedDiamond |
chPatternPlaid |
chPatternShingle |
chPatternSmallCheckerBoard |
chPatternSmallConfetti |
chPatternSmallGrid |
chPatternSolidDiamond |
chPatternSphere |
chPatternTrellis |
chPatternWave |
chPatternWeave |
chPatternWideDownwardDiagonal |
chPatternWideUpwardDiagonal |
chPatternZigZag |
Color Optional Variant. The foreground color for the pattern. You can use either a Long value representing a red-green-blue color value or a String value naming a valid HTML color value. In Microsoft Visual Basic, you can use the RGB function to create a red-green-blue color value (for example, red is RGB(255,0,0)
). If this argument is omitted, then the Color property is used.
BackColor Optional Variant. The background color for the pattern. You can use either a Long value representing a red-green-blue color value or a String value naming a valid HTML color value. In Microsoft Visual Basic, you can use the RGB function to create a red-green-blue color value (for example, red is RGB(255,0,0)
). If this argument is omitted, then the BackColor property is used.
Example
This example sets the interior fill of the first two series and the plot area of the first chart in ChartSpace1.
Sub Format_Interior_Colors()
Dim chConstants
Dim serSeries1
Dim serSeries2
Set chConstants = ChartSpace1.Constants
Set serSeries1 = ChartSpace1.Charts(0).SeriesCollection(0)
Set serSeries2 = ChartSpace1.Charts(0).SeriesCollection(1)
' Set the interior fill of the first series to a one-color gradient.
serSeries1.Interior.SetOneColorGradient chConstants.chGradientDiagonalDown, _
chConstants.chGradientVariantCenter, 0.2, "Blue"
' Set the interior fill of the second series to a preset gradient.
serSeries2.Interior.SetPresetGradient chConstants.chGradientFromCenter, _
chConstants.chGradientVariantEnd, chConstants.chGradientDaybreak
' Set the interior fill of the plot area to a pattern.
ChartSpace1.Charts(0).PlotArea.Interior.SetPatterned chConstants.chPattern10Percent, _
"Yellow", "Blue"
End Sub