首页

DevExpress动态创建统计图

c#

2020-9-1

how-to-programmatically-create-a-chart

using System.Collections;
using System.Windows;
using DevExpress.Xpf.Charts;

namespace DXCharts_Runtime {

    public partial class MainWindow : Window {
        public MainWindow () {
            InitializeComponent();
        }

        private void Window_Loaded (object sender, RoutedEventArgs e) {
            // Create a chart.
            ChartControl chart = new ChartControl();
            
            // Create a diagram.
            XYDiagram2D diagram = new XYDiagram2D();
            chart.Diagram = diagram;

            // Create a bar series.
            BarSideBySideSeries2D series = new BarSideBySideSeries2D();
            diagram.Series.Add(series);

            // Add points to the series.
            series.Points.Add(new SeriesPoint("A", 1));
            series.Points.Add(new SeriesPoint("B", 3));
            series.Points.Add(new SeriesPoint("C", 5));
            series.Points.Add(new SeriesPoint("D", 2));
            series.Points.Add(new SeriesPoint("E", 7));

            // Add the chart to the window.
            this.Content = chart;
        }

    }
}

资源下载此资源下载价格为2D币(VIP免费),请先
资源文件列表
how-to-programmatically-create-a-chart-e3553-11.1.8-/.gitattributes , 112
how-to-programmatically-create-a-chart-e3553-11.1.8-/.gitignore , 4971
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime.sln , 866
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/App.xaml , 316
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/App.xaml.cs , 298
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/DXCharts_Runtime.csproj , 4476
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/MainWindow.xaml , 352
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/MainWindow.xaml.cs , 1096
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/Properties/AssemblyInfo.cs , 2259
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/Properties/Resources.Designer.cs , 2710
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/Properties/Resources.resx , 5496
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/Properties/Settings.Designer.cs , 1047
how-to-programmatically-create-a-chart-e3553-11.1.8-/CS/DXCharts_Runtime/Properties/Settings.settings , 195
how-to-programmatically-create-a-chart-e3553-11.1.8-/LICENSE , 477
how-to-programmatically-create-a-chart-e3553-11.1.8-/Readme.md , 379
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime.sln , 866
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/Application.xaml , 316
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/Application.xaml.vb , 344
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/DXCharts_Runtime.vbproj , 4860
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/MainWindow.xaml , 352
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/MainWindow.xaml.vb , 928
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/My Project/AssemblyInfo.vb , 2137
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/My Project/Resources.Designer.vb , 2491
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/My Project/Resources.resx , 5496
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/My Project/Settings.Designer.vb , 1063
how-to-programmatically-create-a-chart-e3553-11.1.8-/VB/DXCharts_Runtime/My Project/Settings.settings , 195
how-to-programmatically-create-a-chart-e3553-11.1.8-/config.json , 49
没有账号? 忘记密码?

社交账号快速登录