DevExpress

来源:互联网 发布:歌曲剪辑合并软件 编辑:程序博客网 时间:2024/05/16 04:32

1、WebChartControl

a、Adding a webchartcontrol to a page at runtime

    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);
原创粉丝点击