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);

相关文章:

  • 2022-01-25
  • 2021-11-16
  • 2022-12-23
  • 2021-06-06
  • 2021-07-24
  • 2021-11-20
  • 2021-12-13
  • 2022-02-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2021-12-27
  • 2021-06-03
  • 2021-08-02
相关资源
相似解决方案