Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.Standard.v4.4 Assembly / Xceed.Chart.Standard Namespace / FillEffect Class / SetGradient Method
The style of the gradient
The variant of the specified gradient style
The begin color of the gradient.
The end color of the gradient.
Example


In This Topic
    SetGradient Method
    In This Topic
    Use this function to apply a gradient fill effect. Note that this function will also change the current Mapping.
    Syntax
    'Declaration
     
    Public Sub SetGradient( _
       ByVal gradientStyle As GradientStyle, _
       ByVal gradientVariant As GradientVariant, _
       ByVal beginColor As Color, _
       ByVal endColor As Color _
    ) 
    'Usage
     
    Dim instance As FillEffect
    Dim gradientStyle As GradientStyle
    Dim gradientVariant As GradientVariant
    Dim beginColor As Color
    Dim endColor As Color
     
    instance.SetGradient(gradientStyle, gradientVariant, beginColor, endColor)
    public void SetGradient( 
       GradientStyle gradientStyle,
       GradientVariant gradientVariant,
       Color beginColor,
       Color endColor
    )

    Parameters

    gradientStyle
    The style of the gradient
    gradientVariant
    The variant of the specified gradient style
    beginColor
    The begin color of the gradient.
    endColor
    The end color of the gradient.
    Remarks
    Use this function if you want to apply a gradient fill effect. The function will change the Type, GradientStyle, GradientVariant, BeginColor and EndColor properties of the FillEffectBase. It will also replace the current FillEffectMapping object with a texture mapper with stretched layout type and object linear map mode. For more information see the topics under the "Fill Effects" book in the Users Guide.
    Example
    The following example sets a gradient to the left chart wall:
    Dim chart As Chart = CType((ChartControl1.Charts(0)), Chart)
    Dim fillEffect As FillEffectBase =  chart.Wall(ChartWallType.Left).FillEffect 
    fillEffect.SetGradient(GradientStyle.DiagonalDown, GradientVariant.Variant1, Color.Beige, Color.AntiqueWhite)
    Chart chart = (Chart)(ChartControl1.Charts[0]);
    FillEffectBase fillEffect = chart.Wall(ChartWallType.Left).FillEffect;
    fillEffect.SetGradient(GradientStyle.DiagonalDown, GradientVariant.Variant1, Color.Beige, Color.AntiqueWhite);
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also