Devexpress ChartControl 柱状图简单例子

  

//using DevExpress.XtraEditors;
//using DevExpress.XtraCharts;

// Create an empty chart. ChartControl sideBySideBarChart = new ChartControl(); // Create the first side-by-side bar series and add points to it. Series series1 = new Series("Side-by-Side Bar Series 1", ViewType.Bar); series1.Points.Add(new SeriesPoint("A", 10)); series1.Points.Add(new SeriesPoint("B", 12)); series1.Points.Add(new SeriesPoint("C", 14)); series1.Points.Add(new SeriesPoint("D", 17)); // Create the second side-by-side bar series and add points to it. Series series2 = new Series("Side-by-Side Bar Series 2", ViewType.Bar); series2.Points.Add(new SeriesPoint("A", 15)); series2.Points.Add(new SeriesPoint("B", 18)); series2.Points.Add(new SeriesPoint("C", 25)); series2.Points.Add(new SeriesPoint("D", 33)); // Add the series to the chart. sideBySideBarChart.Series.Add(series1); sideBySideBarChart.Series.Add(series2); // Hide the legend (if necessary). sideBySideBarChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; // Rotate the diagram (if necessary). //((XYDiagram)sideBySideBarChart.Diagram).Rotated = true; // Add a title to the chart (if necessary). ChartTitle chartTitle1 = new ChartTitle(); chartTitle1.Text = "Side-by-Side Bar Chart"; sideBySideBarChart.Titles.Add(chartTitle1); // Add the chart to the form. sideBySideBarChart.Dock = DockStyle.Fill; this.Controls.Add(sideBySideBarChart);

转载于:https://www.cnblogs.com/habin/p/6580888.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值