C# - A Simple Infragistics Ultra-Web-Chart Bar-Graph Example

I'm not a big fan of Infragistics. One of my biggest annoyances with them is that it's really had to find documentation on how the different controls work. Since I couldn't find a simple example of manually loading data into their UltraWebChart control (though many ultra-complicated ones) I thought I'd post the code here in the hopes it may help some of you out there.

If you drop an UltraWebChart on a page and add this code you'll get something that you can start to play with.

protected void Page_Load(object sender, EventArgs e){

UltraChart1.ChartType = ChartType.ColumnChart;

DataTable columnData = new DataTable("ColumnData");

columnData.Columns.Add("Month", typeof(string));

columnData.Columns.Add("Foo", typeof(double));

columnData.Columns.Add("Bar", typeof(double));

//Add additional columns here; for each column add a parameter to each row below.

//Below uses params so additional columns of data are comma delimited

columnData.Rows.Add("Jan"/*Month*/, 3400/*Foo*/, 1200/*Bar*/ /*, YourNewColumn*/);

columnData.Rows.Add("Feb", 2300, 1200);

columnData.Rows.Add("Mar", 5994, 1200);

UltraChart1.DataSource = columnData;

UltraChart1.DataBind();

}