gopikrish Posted December 20, 2010 Report Share Posted December 20, 2010 In asp.net in VS2005 for webform, I have a DataSet which has the resultset from a table. And I am assigning it to Chart object as follows, Chart1.DataSource = ds.tables[0]; Chart1.DataBind(); But instead of assigning a full table to Chart object, I need to assign a certain columns alone to it. Is that possible? Like will this work as given below... Chart1.DataSource = ds.tables[0].Columns[4]; Chart1.DataSource = ds.tables[0].Columns[5]; ...... Thanks in advance. Quote Link to comment Share on other sites More sharing options...
CarlosAC Posted December 22, 2010 Report Share Posted December 22, 2010 Hi gopikrish You can try adding some FieldMap object to the DataSourceSettings. Those objects allows you to configure how Chart FX will store the data provided by the DataProvider. Please check the following code: chart1.DataSourceSettings.Fields.Add(new FieldMap("Date",FieldUsage.XValue)); chart1.DataSourceSettings.Fields.Add(new FieldMap("High",FieldUsage.Value)); chart1.DataSourceSettings.Fields.Add(new FieldMap("Low",FieldUsage.Value)); chart1.DataSourceSettings.Fields.Add(new FieldMap("Closed",FieldUsage.Value)); chart1.DataSource = ds.Tables[0]; More information in Chart FX Samples & Resource Center >>> API Reference >>> Chart FX WebForms >>> DataSourceSetttings Class >>> Properties >>> Fields. Carlos Chaves Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.