Spread ASP.NET 14
FarPoint.Web.Chart Assembly / FarPoint.Web.Chart Namespace / GradientStyle Enumeration
Example Example


In This Topic
    GradientStyle Enumeration
    In This Topic
    Specifies the direction of a linear gradient.
    Syntax
    'Declaration
     
    Public Enum GradientStyle 
       Inherits System.Enum
    'Usage
     
    Dim instance As GradientStyle
    public enum GradientStyle : System.Enum 
    Members
    MemberDescription
    BackwardDiagonalGradient is from top right to bottom left
    ForwardDiagonalGradient is from top left to bottom right
    HorizontalGradient is from left to right
    VerticalGradient is from top to bottom
    Example
    This example sets the GradientStyle enumeration.
    FarPoint.Web.Chart.AreaSeries aseries = new FarPoint.Web.Chart.AreaSeries();
    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.Azure, System.Drawing.Color.Bisque);
    FarPoint.Web.Chart.AreaSeries aseries1 = new FarPoint.Web.Chart.AreaSeries();
    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.Azure, System.Drawing.Color.Bisque);
    aseries.AreaBorder = new FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Blue);
    // OR
    //aseries1.AreaFill = new FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Azure, System.Drawing.Color.Bisque, FarPoint.Web.Chart.GradientStyle.ForwardDiagonal);
    //aseries.AreaBorder = new FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Blue, 2);
    
    //aseries1.AreaFills.Add(new FarPoint.Web.Chart.SolidFill(System.Drawing.Color.LightGreen));
    //aseries1.AreaBorders.AddRange(new FarPoint.Web.Chart.Line[] { new FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Black), new
    FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Red), new FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Aqua), null
    });
    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.LabelArea Label = new FarPoint.Web.Chart.LabelArea();
    Label.Text = "Area Chart";
    Label.Location = new System.Drawing.PointF(0.5F, 0.02F);
    FarPoint.Web.Chart.LegendArea legend = new FarPoint.Web.Chart.LegendArea();
    legend.Location = new System.Drawing.PointF(0.80F, 0.5F);
    FarPoint.Web.Chart.ChartModel model = new FarPoint.Web.Chart.ChartModel();
    model.LabelAreas.Add(Label);
    model.LegendAreas.Add(legend);
    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);
    Dim aseries As New FarPoint.Web.Chart.AreaSeries
    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.Azure, System.Drawing.Color.Bisque)
    
    Dim aseries1 As New FarPoint.Web.Chart.AreaSeries
    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.Azure, System.Drawing.Color.Bisque)
    aseries.AreaBorder = New FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Blue)
    ' OR
    'aseries1.AreaFill = New FarPoint.Web.Chart.GradientFill(System.Drawing.Color.Azure, System.Drawing.Color.Bisque, FarPoint.Web.Chart.GradientStyle.ForwardDiagonal)
    'aseries.AreaBorder = New FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Blue, 2)
    
    'aseries1.AreaFills.Add(New FarPoint.Web.Chart.SolidFill(System.Drawing.Color.LightGreen))
    'aseries1.AreaBorders.AddRange(New FarPoint.Web.Chart.Line() {New FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Black), New FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Red), New FarPoint.Web.Chart.SolidLine(System.Drawing.Color.Aqua), Nothing})
    
    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 Label As New FarPoint.Web.Chart.LabelArea()
    Label.Text = "Area Chart"
    Label.Location = New System.Drawing.PointF(0.5F, 0.02F)
    Label.AlignmentX = 0.5F
    Label.AlignmentY = 0.0F
    
    Dim legend As New FarPoint.Web.Chart.LegendArea()
    legend.Location = New System.Drawing.PointF(0.98F, 0.5F)
    legend.AlignmentX = 1.0F
    legend.AlignmentY = 0.5F
    
    Dim model As New FarPoint.Web.Chart.ChartModel()
    model.LabelAreas.Add(Label)
    model.LegendAreas.Add(legend)
    model.PlotAreas.Add(plotArea)
    Dim chart As New FarPoint.Web.Spread.Chart.SpreadChart()
    chart.Model = model
    FpSpread1.Sheets(0).Charts.Add(chart)
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             FarPoint.Web.Chart.GradientStyle

    See Also