[]
        
(Showing Draft Content)

Waterfall Chart

Waterfall charts are statistical tools that visually represent the cumulative effect of values being added or subtracted. They are particularly useful for understanding how an initial value is influenced by a series of positive and negative changes. Waterfall charts are commonly used to analyze fluctuations in product earnings, net income, or overall profit.

Sample Image

Description


ChartType.Waterfall Represents a waterfall chart.

It is used to present data inflows and outflows.

Refer to the following example code to add a waterfall chart.

C#

// Enable enhanced shape and chart engines.
fpSpread1.Features.EnhancedShapeEngine = true;
fpSpread1.Features.EnhancedChartEngine = true;
// Waterfall chart.
object[,] dataArray = {
    { "Start", 800 },
    { "January", 1000 },
    { "February", 1200 },
    { "March", 500 },
    { "April", -800 },
    { "May", -400 },
    { "June", 300 },
    { "July", -700 },
    { "August", -1000 },
    { "September", 700 },
    { "October", 1200 },
    { "November", 2000 },
    { "December", 2400 },
    { "End", 7200 }
};
for (int i = 0; i < dataArray.GetLength(0); i++)
{
    for (int j = 0; j < dataArray.GetLength(1); j++)
    {
        fpSpread1.AsWorkbook().ActiveSheet.Cells[i, j].Value = dataArray[i, j];
    }
}
fpSpread1.AsWorkbook().ActiveSheet.Cells["A1:B14"].Select();
fpSpread1.AsWorkbook().ActiveSheet.Shapes.AddChart(
    GrapeCity.Spreadsheet.Charts.ChartType.Waterfall, 
    100, 150, 800, 300, false
);

VB

' Enable enhanced shape and chart engines.
fpSpread1.Features.EnhancedShapeEngine = True
fpSpread1.Features.EnhancedChartEngine = True
' Waterfall chart.
Dim dataArray As Object(,) = {
    {"Start", 800},
    {"January", 1000},
    {"February", 1200},
    {"March", 500},
    {"April", -800},
    {"May", -400},
    {"June", 300},
    {"July", -700},
    {"August", -1000},
    {"September", 700},
    {"October", 1200},
    {"November", 2000},
    {"December", 2400},
    {"End", 7200}
}
For i As Integer = 0 To dataArray.GetLength(0) - 1
    For j As Integer = 0 To dataArray.GetLength(1) - 1
        fpSpread1.AsWorkbook().ActiveSheet.Cells(i, j).Value = dataArray(i, j)
    Next
Next
fpSpread1.AsWorkbook().ActiveSheet.Cells("A1:B14").Select()
fpSpread1.AsWorkbook().ActiveSheet.Shapes.AddChart(
    GrapeCity.Spreadsheet.Charts.ChartType.Waterfall,
    100, 150, 800, 300, False
)