Hi Sebastian,
The WebChartControl doesn't have the Dock property, and hence it can't be specified. Please try the code below to create a WebChartControl at runtime (note that you need to specify your own credentials when creating an SqlDataSource object instead of "YourServerName", "YourDatabaseName" and other parameters).
protected void Page_Load(object sender, EventArgs e) {
SqlDataSource dataSource = new SqlDataSource("Data Source=YourServerName;Initial Catalog=YourDatabaseName;Persist Security Info=True;User ID=YourUserID;Password=YourPassword", "SELECT SalesPerson, Product, SUM(Sales) Sales FROM Products");
WebChartControl chart = new WebChartControl();
chart.Width = 500;
chart.Height = 300;
chart.DataSource = dataSource;
chart.SeriesDataMember = "SalesPerson";
chart.SeriesTemplate.ArgumentDataMember = "Product";
chart.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "Sales" });
chart.SeriesTemplate.View = new StackedBarSeriesView();
this.Controls.Add(chart);
}
Does this work for you?
@.
R&D, .NET Team.
PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/sc.