- Open Visual Studio and create a new WinForms project. To create a Waterfall chart, look for the FlexChart control in the Toolbox under the C1 WinForms 4.0 Tab.
- Drag and drop the FlexChart control from the toolbox to the Form’s design surface. This adds FlexChart to the view along with the required references to your project.
- Next, we’ll set up the data to be plotted on the Waterfall.
- For this video, we’ll be plotting the Monthly sales of an organization. The Month names will be plotted on the X-Axis and their corresponding sales amount on the Y-Axis.
- Begin configuring the chart by first setting up its DataSource.
- Then set the chart’s BindingX to the property name that contains the X-Axis values
- Now we’ll add a Series to the chart to configure the Y-axis values.
- For creating a waterfall chart, instead of the regular Series object, we’ll create a Waterfall Series object.
- Next, set the series Binding to the property name that contains the Y-axis values, which in this case, is SalesAmount.
- Next, clear the Series collection, and add the waterfall series object to it. This creates a basic Waterfall chart.
- Run the application to view it.
Let’s look at displaying start and total values.
- To display start value, set the waterfall series’ Start value and Label to display the starting value.
- To display the Total bar, set the series’ ShowTotal to true and set the TotalLabel.
Let’s look at intermediate totals next.
- To display Intermediate totals, set the labels for the intermediate total bars using the IntermediateTotalLabels property.
- Next, set the IntermediateTotalPositions property of the series to define the data point indexes after which the totals will be displayed.
- Set the ShowIntermediateTotal property to True to make the intermediate total bars visible.
Lastly, let’s look at styling Waterfall charts.
Styling allows you to better differentiate between the plotted bars. You can customize the StartStyle, RisingStyle, FallingStyle, IntermediateTotalStyle, and the TotalStyle.
Learn more at http://www.componentone.com/Studio/FlexChart