DevExpress 柱状图

通过构造函数,把值传递过来

1   public XtraInterpreterChartForm(object ds)
2         {
3             InitializeComponent();
4             datasource = ds;
5         }

设置形状,数据等:

 1  // Create a pie series.
 2             Series series1 = new Series("Bar Series 1", ViewType.Bar);
 3             chartControl1.Series.Add(series1);
 4             chartControl1.DataSource = datasource;
 5 
 6             // Adjust the value numeric options of the series.
 7             series1.ArgumentDataMember = "Username";
 8             series1.ValueDataMembers.AddRange(new string[] { "WordCount" });
 9 
10             ((BarSeriesView)series1.View).ColorEach = true;
11             series1.LegendPointOptions.Pattern = "{A}";
12 
13             // Add a title to the chart and hide the legend.
14             ChartTitle chartTitle1 = new ChartTitle {Text = "译员剩余字数信息"};
15             chartControl1.Titles.Add(chartTitle1);
16             chartControl1.Legend.Visible = true;
17 
18             // Add the chart to the form.
19             chartControl1.Dock = DockStyle.Fill;
20             Controls.Add(chartControl1);

原文地址:https://www.cnblogs.com/QQ931697811/p/4383309.html