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();
}

2 - What do you think?:
Thank you for your post, it helps me to understand a little bit more how the chart component works. It would be great if you can upload a real example of the component, just to see how it works.
Sorry, I worked with this at a past job so it's been a while and I no longer have infragistics controls available to me. Best of luck.
Post a Comment