Siticone Waterfall Chart
The SiticoneWaterfallChart is a specialized data visualization tool used to understand how an initial value is affected by a series of intermediate positive or negative values.
It is commonly used in financial analysis to show how a net value is arrived at (e.g., from Revenue to Net Profit).
Data Binding
To render a waterfall chart, map the data source fields to the Label (category), Value (numeric impact), and optionally IsTotal (subtotals/totals).
| Property | Type | Description & Usage Example |
|---|---|---|
DataSource |
object |
chart.DataSource = myFinancialData;
The source of the data. Accepts DataTable, List<T>, or IEnumerable.
|
LabelMember |
string | chart.LabelMember = "CategoryName"; The name of the property or column containing the category labels (e.g., "Sales", "Cost of Goods"). |
ValueMember |
string | chart.ValueMember = "Amount"; The name of the property or column containing the numeric values. Positive values increase the total, negative decrease it. |
IsTotalMember |
string | chart.IsTotalMember = "IsSubTotal"; Optional. The name of a boolean property indicating if the bar represents a running total (e.g., "Gross Profit") rather than a change. |
Appearance & Theming
Customize the colors for positive changes, negative changes, and totals.
| Property | Type | Description & Usage Example |
|---|---|---|
Theme |
WaterfallThemePreset |
chart.Theme = WaterfallThemePreset.Financial;
Applies a preset color scheme. Options include Financial, Ocean, Forest, etc.
|
PositiveColor |
Color | chart.PositiveColor = Color.SeaGreen; The color for bars representing positive values (increases). |
NegativeColor |
Color | chart.NegativeColor = Color.IndianRed; The color for bars representing negative values (decreases). |
TotalColor |
Color | chart.TotalColor = Color.SteelBlue; The color for bars representing totals or subtotals. |
ConnectorLineColor |
Color | chart.ConnectorLineColor = Color.Gray; The color of the lines connecting adjacent bars. |
ConnectorLineStyle |
DashStyle | chart.ConnectorLineStyle = DashStyle.Dot; The dash style of the connector lines. |
ShowValueLabels |
bool | chart.ShowValueLabels = true; Displays the numeric value above or below each bar. |
Behavior & Interaction
Control animations and user feedback.
| Property | Type | Description & Usage Example |
|---|---|---|
EnableAnimations |
bool | chart.EnableAnimations = true; If true, bars animate vertically (grow) when data is loaded. |
EnableHighlight |
bool | chart.EnableHighlight = true; Highlights the bar under the mouse cursor by brightening its color. |
Public Methods
// Forces the chart to process the DataSource and render the bars.
// Call this after changing data or member mappings.
waterfallChart.DataBind();
Events
Respond to user interaction with bars.
// 1. BarClick Event
// Fires when a user clicks a bar.
chart.BarClick += (s, e) =>
{
MessageBox.Show($"Category: {e.Label}\nAmount: {e.Value:C}");
};
// 2. BarHover Event
// Fires when the mouse enters a bar.
chart.BarHover += (s, e) =>
{
statusLabel.Text = $"Analyzing: {e.Label}";
};
Detailed Usage Examples
Example 1: Profit and Loss Statement (DataTable)
Visualizing a simple P&L statement.
private void LoadPnLData()
{
DataTable dt = new DataTable();
dt.Columns.Add("Item", typeof(string));
dt.Columns.Add("Value", typeof(double));
dt.Columns.Add("IsTotal", typeof(bool));
dt.Rows.Add("Product Revenue", 10000, false);
dt.Rows.Add("Service Revenue", 5000, false);
dt.Rows.Add("COGS", -4000, false);
dt.Rows.Add("Gross Profit", 11000, true); // Subtotal
dt.Rows.Add("Marketing", -2000, false);
dt.Rows.Add("Salaries", -5000, false);
dt.Rows.Add("Net Income", 4000, true); // Final Total
waterfallChart.DataSource = dt;
waterfallChart.LabelMember = "Item";
waterfallChart.ValueMember = "Value";
waterfallChart.IsTotalMember = "IsTotal";
// Styling
waterfallChart.Theme = WaterfallThemePreset.Financial;
waterfallChart.DataBind();
}
Example 2: Inventory Changes (List of Objects)
Tracking inventory levels over a period.
public class InventoryLog
{
public string Action { get; set; }
public int Qty { get; set; }
public bool IsBalance { get; set; }
}
private void LoadInventoryData()
{
var logs = new List<InventoryLog>
{
new InventoryLog { Action = "Opening Stock", Qty = 500, IsBalance = true },
new InventoryLog { Action = "Purchase", Qty = 200, IsBalance = false },
new InventoryLog { Action = "Sales", Qty = -350, IsBalance = false },
new InventoryLog { Action = "Returns", Qty = 20, IsBalance = false },
new InventoryLog { Action = "Closing Stock", Qty = 370, IsBalance = true }
};
waterfallChart.DataSource = logs;
waterfallChart.LabelMember = "Action";
waterfallChart.ValueMember = "Qty";
waterfallChart.IsTotalMember = "IsBalance";
// Custom Green Theme
waterfallChart.Theme = WaterfallThemePreset.Forest;
waterfallChart.DataBind();
}
Enumerations
public enum WaterfallThemePreset
{
Custom,
Financial, // Green pos, Red neg, Blue total
Ocean,
Forest,
Graphite,
Sunset,
// ... and many more
}