[]
        
(Showing Draft Content)

Area Chart

Area charts are similar to line charts, but they fill an area between the line chart and the axis with color or shading. These charts represent the changes in one or more data quantities over time. In area charts, the data points are plotted and connected by line segments. This helps in showing the magnitude of the value at different time intervals. While line charts simply present the data values to demonstrate the trends, the filled portion of the area chart enhances communicating the magnitude of the trend as well.

Types of Area Charts

Spread Windows Forms supports the following types of area charts.

Sample Image

Description


ChartType.Area

 

Represents an area chart.

It is used to depict the data series as colored regions that help in comparing the values of multiple series for the same data point. This chart shows trends over time (years, months, and days) or categories.


ChartType.AreaStacked

 

Represents a stacked area chart.

It is used to depict data series as stacked regions with different colors that help in performing comparisons between multiple series for the same data point. This chart shows the trend of the contribution of each value over time or other categorical data.


ChartType.AreaStacked100

 

Represents a 100% stacked area chart.

It is used to depict the series of data points with positive and negative values shown over time to reveal values of multiple series for the same data point. This chart shows the percentage that each value contributes over time or other categorical data.

Refer to the following example code to add an area chart.

C#

// Enable enhanced shape and chart engines.
fpSpread1.Features.EnhancedShapeEngine = true;
fpSpread1.Features.EnhancedChartEngine = true;
// Add data.
fpSpread1.AsWorkbook().ActiveSheet.Cells[0, 1].Value = "Q1";
fpSpread1.AsWorkbook().ActiveSheet.Cells[0, 2].Value = "Q2";
fpSpread1.AsWorkbook().ActiveSheet.Cells[0, 3].Value = "Q3";
fpSpread1.AsWorkbook().ActiveSheet.Cells[1, 0].Value = "Mobile Phones";
fpSpread1.AsWorkbook().ActiveSheet.Cells[2, 0].Value = "Laptops";
fpSpread1.AsWorkbook().ActiveSheet.Cells[3, 0].Value = "Tablets";
Random random = new Random();
for (var r = 1; r <= 3; r++)
{
    for (var c = 1; c <= 3; c++)
    {
        fpSpread1.AsWorkbook().ActiveSheet.Cells[r, c].Value = random.Next(0, 100);
    }
}
fpSpread1.AsWorkbook().ActiveSheet.Cells["A1:D4"].Select();
// Add area chart.
fpSpread1.AsWorkbook().ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Area, 100, 150, 400, 300, false);

VB

' Enable enhanced shape and chart engines.
fpSpread1.Features.EnhancedShapeEngine = True
fpSpread1.Features.EnhancedChartEngine = True
' Add data.
fpSpread1.AsWorkbook().ActiveSheet.Cells(0, 1).Value = "Q1"
fpSpread1.AsWorkbook().ActiveSheet.Cells(0, 2).Value = "Q2"
fpSpread1.AsWorkbook().ActiveSheet.Cells(0, 3).Value = "Q3"
fpSpread1.AsWorkbook().ActiveSheet.Cells(1, 0).Value = "Mobile Phones"
fpSpread1.AsWorkbook().ActiveSheet.Cells(2, 0).Value = "Laptops"
fpSpread1.AsWorkbook().ActiveSheet.Cells(3, 0).Value = "Tablets"
Dim random As New Random()
For r As Integer = 1 To 3
    For c As Integer = 1 To 3
        fpSpread1.AsWorkbook().ActiveSheet.Cells(r, c).Value = random.Next(0, 100)
    Next
Next
fpSpread1.AsWorkbook().ActiveSheet.Cells("A1:D4").Select()
' Add area chart.
fpSpread1.AsWorkbook().ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Area, 100, 150, 400, 300, False)