Home > ASP.NET > Waterfall using asp.net chart control

Waterfall using asp.net chart control

Designing a waterfall chart using asp.net charting control is a bit trick as it doesn’t support Waterfall series type. But we can do it by using RangeColumn series type and bit of code.

Step 1:
Drop a asp.net chart control on page with having a series of RangeColumn type.

Step 2 :

Next step is to add data points to your chart and make it to look like waterfall chart. RangeColumn series type provides a way to add your Y-Axis value in a range, you can specify your starting and ending values for a data point like this:

Adding a first point

cWaterfall.Series[0].Points.AddXY("First Item", new object[] { 0, 500 });
cWaterfall.Series[0].Points[0].Label = "500"
cWaterfall.Series[0].Points[0].Color = Color.SkyBlue;

Adding a second point

cWaterfall.Series[0].Points.AddXY("Second Item", new object[] { 500, 700 });
cWaterfall.Series[0].Points[1].Label = "200"
cWaterfall.Series[0].Points[1].Color = Color.Green;

By using the above approach you can create a waterfall chart like this

waterfall chart


Advertisement
Categories: ASP.NET
  1. Marko
    December 6, 2011 at 11:55 am | #1

    Nice post. Saved me a lot of time.

    Thanks and keep on!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.