Spread for ASP.NET 7.0 Product Documentation
GradientFill Constructor(Color,Color)
See Also  Example Support Options
FarPoint.Web.Chart Assembly > FarPoint.Web.Chart Namespace > GradientFill Class > GradientFill Constructor : GradientFill Constructor(Color,Color)


color0
Start color of the gradient
color1
End color of the gradient

Glossary Item Box

Creates a new gradient fill with the specified colors.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal color0 As Color, _
   ByVal color1 As Color _
)
Visual Basic (Usage)Copy Code
Dim color0 As Color
Dim color1 As Color
 
Dim instance As New GradientFill(color0, color1)
C# 
public GradientFill( 
   Color color0,
   Color color1
)

Parameters

color0
Start color of the gradient
color1
End color of the gradient

Example

This example creates a gradient fill.
C#Copy Code
FarPoint.Web.Chart.AreaSeries aseries = new FarPoint.Web.Chart.AreaSeries();
FarPoint.Web.Chart.AreaSeries aseries1 = new FarPoint.Web.Chart.AreaSeries();

        protected void Page_Load(object sender, EventArgs e)
    {
        aseries.SeriesName = "Series1";
        aseries.Values.Add(2);
        aseries.Values.Add(4);
        aseries.Values.Add(3);
        aseries.Values.Add(5);
        aseries.AreaFill = new FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Aquamarine,System.Drawing.Color.DarkBlue);

        aseries1.SeriesName = "Series2";
        aseries1.Values.Add(1);
        aseries1.Values.Add(2);
        aseries1.Values.Add(4);
        aseries1.Values.Add(8);
        aseries1.AreaFill = new FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Coral, System.Drawing.Color.Crimson);
        aseries1.AreaBorder = new FarPoint.Web.Chart.SolidLine(System.Drawing.Color.DarkSalmon);

        FarPoint.Web.Chart.YPlotArea plotArea = new FarPoint.Web.Chart.YPlotArea();
        plotArea.Location = new System.Drawing.PointF(0.2F, 0.2F);
        plotArea.Size = new System.Drawing.SizeF(0.6F, 0.6F);
        plotArea.Series.Add(aseries);
        plotArea.Series.Add(aseries1);

        FarPoint.Web.Chart.ChartModel model = new FarPoint.Web.Chart.ChartModel();
        model.PlotAreas.Add(plotArea);
        FarPoint.Web.Spread.Chart.SpreadChart chart = new FarPoint.Web.Spread.Chart.SpreadChart();
        chart.Model = model;
        FpSpread1.Sheets[0].Charts.Add(chart);       
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        aseries.Values.Clear();
        aseries1.Values[3] = 1;
        double v;
        v = aseries1.Values[3];
        textBox1.Text = v.ToString();
        aseries1.AreaFills[1] = new FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Aquamarine,System.Drawing.Color.DarkBlue);
        object effect;
        effect = aseries1.AreaFills[1];
       textBox1.Text = effect.ToString();
    }
Visual BasicCopy Code
Dim aseries As New FarPoint.Web.Chart.AreaSeries
Dim aseries1 As New FarPoint.Web.Chart.AreaSeries

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
aseries.SeriesName = "Series1"
aseries.Values.Add(2.0)
aseries.Values.Add(4.0)
aseries.Values.Add(3.0)
aseries.Values.Add(5.0)
aseries.AreaFill = New FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Aquamarine, System.Drawing.Color.DarkBlue)

aseries1.SeriesName = "Series2"
aseries1.Values.Add(1.0)
aseries1.Values.Add(2.0)
aseries1.Values.Add(4.0)
aseries1.Values.Add(8.0)
aseries1.AreaFill = New FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Coral, System.Drawing.Color.Crimson)
aseries1.AreaBorder = New FarPoint.Web.Chart.SolidLine(System.Drawing.Color.DarkSalmon)

Dim plotArea As New FarPoint.Web.Chart.YPlotArea()
plotArea.Location = New System.Drawing.PointF(0.2F, 0.2F)
plotArea.Size = New System.Drawing.SizeF(0.6F, 0.6F)
plotArea.series.Add(aseries)
plotArea.series.Add(aseries1)

Dim model As New FarPoint.Web.Chart.ChartModel()
model.PlotAreas.Add(plotArea)
Dim chart As New FarPoint.Web.Spread.Chart.SpreadChart()
chart.Model = model
FpSpread1.Sheets(0).Charts.Add(chart)
End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
aseries.Values.Clear()
aseries1.Values(3) = 1

Dim v As Double
v = aseries1.Values(3)
TextBox1.Text = v.ToString()

aseries1.AreaFills(1) = New FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Aquamarine, System.Drawing.Color.DarkBlue)
Dim effect As Object
effect = aseries1.AreaFills(1)
TextBox1.Text = effect.ToString()
End Sub

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.