コード例 #1
0
        public override void BeginInitialize( )
        {
            seriesLabel  = new DevExpress.XtraCharts.PieSeriesLabel();
            seriesView   = new DevExpress.XtraCharts.PieSeriesView();
            pointOptions = new DevExpress.XtraCharts.PiePointOptions();

            base.BeginInitialize();
        }
コード例 #2
0
 private void InitializeComponent()
 {
     DevExpress.XtraCharts.PieSeriesLabel  pieSeriesLabel1  = new DevExpress.XtraCharts.PieSeriesLabel();
     DevExpress.XtraCharts.PiePointOptions piePointOptions1 = new DevExpress.XtraCharts.PiePointOptions();
     DevExpress.XtraCharts.PieSeriesView   pieSeriesView1   = new DevExpress.XtraCharts.PieSeriesView();
     this.layoutControl1      = new DevExpress.XtraLayout.LayoutControl();
     this.chartControl2       = new DevExpress.XtraCharts.ChartControl();
     this.chartControl1       = new DevExpress.XtraCharts.ChartControl();
     this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlGroup3 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem2  = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem1  = new DevExpress.XtraLayout.LayoutControlItem();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
     this.layoutControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
     this.SuspendLayout();
     //
     // layoutControl1
     //
     this.layoutControl1.Controls.Add(this.chartControl2);
     this.layoutControl1.Controls.Add(this.chartControl1);
     this.layoutControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl1.Location = new System.Drawing.Point(0, 0);
     this.layoutControl1.Name     = "layoutControl1";
     this.layoutControl1.Root     = this.layoutControlGroup1;
     this.layoutControl1.Size     = new System.Drawing.Size(523, 435);
     this.layoutControl1.TabIndex = 0;
     this.layoutControl1.Text     = "layoutControl1";
     //
     // chartControl2
     //
     this.chartControl2.Location                 = new System.Drawing.Point(5, 272);
     this.chartControl2.Name                     = "chartControl2";
     this.chartControl2.SeriesSerializable       = new DevExpress.XtraCharts.Series[0];
     piePointOptions1.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.General;
     pieSeriesLabel1.PointOptions                = piePointOptions1;
     this.chartControl2.SeriesTemplate.Label     = pieSeriesLabel1;
     pieSeriesView1.ExplodeMode                  = DevExpress.XtraCharts.PieExplodeMode.MinValue;
     pieSeriesView1.RuntimeExploding             = true;
     this.chartControl2.SeriesTemplate.View      = pieSeriesView1;
     this.chartControl2.Size                     = new System.Drawing.Size(513, 158);
     this.chartControl2.TabIndex                 = 5;
     //
     // chartControl1
     //
     this.chartControl1.Legend.Visible     = false;
     this.chartControl1.Location           = new System.Drawing.Point(5, 25);
     this.chartControl1.Name               = "chartControl1";
     this.chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[0];
     this.chartControl1.Size               = new System.Drawing.Size(513, 217);
     this.chartControl1.TabIndex           = 4;
     //
     // layoutControlGroup1
     //
     this.layoutControlGroup1.CustomizationFormText       = "layoutControlGroup1";
     this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.layoutControlGroup1.GroupBordersVisible         = false;
     this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlGroup3,
         this.layoutControlGroup2
     });
     this.layoutControlGroup1.Location    = new System.Drawing.Point(0, 0);
     this.layoutControlGroup1.Name        = "layoutControlGroup1";
     this.layoutControlGroup1.Padding     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup1.Size        = new System.Drawing.Size(523, 435);
     this.layoutControlGroup1.Text        = "layoutControlGroup1";
     this.layoutControlGroup1.TextVisible = false;
     //
     // layoutControlGroup3
     //
     this.layoutControlGroup3.CustomizationFormText = "饼状图";
     this.layoutControlGroup3.ExpandButtonLocation  = DevExpress.Utils.GroupElementLocation.AfterText;
     this.layoutControlGroup3.ExpandButtonVisible   = true;
     this.layoutControlGroup3.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlItem2
     });
     this.layoutControlGroup3.Location = new System.Drawing.Point(0, 247);
     this.layoutControlGroup3.Name     = "layoutControlGroup3";
     this.layoutControlGroup3.Padding  = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup3.Size     = new System.Drawing.Size(523, 188);
     this.layoutControlGroup3.Text     = "饼状图";
     //
     // layoutControlItem2
     //
     this.layoutControlItem2.Control = this.chartControl2;
     this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
     this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem2.Name     = "layoutControlItem2";
     this.layoutControlItem2.Size     = new System.Drawing.Size(517, 162);
     this.layoutControlItem2.Text     = "layoutControlItem2";
     this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem2.TextToControlDistance = 0;
     this.layoutControlItem2.TextVisible           = false;
     //
     // layoutControlGroup2
     //
     this.layoutControlGroup2.CustomizationFormText = "统计图";
     this.layoutControlGroup2.ExpandButtonLocation  = DevExpress.Utils.GroupElementLocation.AfterText;
     this.layoutControlGroup2.ExpandButtonVisible   = true;
     this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlItem1
     });
     this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0);
     this.layoutControlGroup2.Name     = "layoutControlGroup2";
     this.layoutControlGroup2.Padding  = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup2.Size     = new System.Drawing.Size(523, 247);
     this.layoutControlGroup2.Text     = "柱状图";
     //
     // layoutControlItem1
     //
     this.layoutControlItem1.Control = this.chartControl1;
     this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
     this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem1.Name     = "layoutControlItem1";
     this.layoutControlItem1.Size     = new System.Drawing.Size(517, 221);
     this.layoutControlItem1.Text     = "layoutControlItem1";
     this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem1.TextToControlDistance = 0;
     this.layoutControlItem1.TextVisible           = false;
     //
     // UCPipeNodeStatsChart
     //
     this.Controls.Add(this.layoutControl1);
     this.Name = "UCPipeNodeStatsChart";
     this.Size = new System.Drawing.Size(523, 435);
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
     this.layoutControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
     this.ResumeLayout(false);
 }
コード例 #3
0
ファイル: DiagramForm.cs プロジェクト: xuanximoming/key
        private void InitSpline2Inner(string enumValue, string titleName, DataTable dt, Color color)
        {
            Series series = new Series(titleName, (ViewType)Enum.Parse(typeof(ViewType), enumValue));

            DevExpress.XtraCharts.PointSeriesLabel         pointSeriesLabel1      = new DevExpress.XtraCharts.PointSeriesLabel();
            DevExpress.XtraCharts.PieSeriesLabel           pieSeriesLabel1        = new DevExpress.XtraCharts.PieSeriesLabel();
            DevExpress.XtraCharts.SideBySideBarSeriesLabel sideBySizeSeriesLabel1 = new SideBySideBarSeriesLabel();

            //************************************************************BeginInit()********************************************************
            ((System.ComponentModel.ISupportInitialize)(chartControl1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(series)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(pointSeriesLabel1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(sideBySizeSeriesLabel1)).BeginInit();

            series.ArgumentScaleType = ScaleType.Qualitative;

            DevExpress.XtraCharts.PiePointOptions piePointOptions1 = new DevExpress.XtraCharts.PiePointOptions();
            piePointOptions1.PointView = DevExpress.XtraCharts.PointView.ArgumentAndValues;
            series.PointOptions        = piePointOptions1;

            series.LegendText = m_ColumnName;
            series.View.Color = color;
            foreach (DataRow dataRow in dt.Rows)
            {
                string name = dataRow[m_X_NameID + "#" + m_X_Name].ToString();
                if (name == "总计")
                {
                    continue;
                }
                string      value = dataRow[m_ColumnID + "#" + m_ColumnName].ToString();
                SeriesPoint sp    = new SeriesPoint(name, value);
                series.Points.Add(sp);
            }
            chartControl1.Series.Add(series);

            PointSeriesView pointView = series.View as PointSeriesView;

            if (pointView != null)
            {
                pointView.PointMarkerOptions.Kind = MarkerKind.Circle;
            }

            //针对饼图的处理
            if (series.View is PieSeriesView)
            {
                this.chartControl1.RuntimeSelection           = false;
                ((PieSeriesView)series.View).RuntimeExploding = true;
            }
            else
            {
                this.chartControl1.RuntimeSelection = true;
            }

            ChartTitle ct1 = new ChartTitle();

            ct1.Text = titleName;
            chartControl1.Titles.Clear();
            chartControl1.Titles.Add(ct1);

            if (series.Label is PointSeriesLabel)
            {
                pointSeriesLabel1.LineLength   = 15;
                pointSeriesLabel1.LineVisible  = true;
                pointSeriesLabel1.Antialiasing = true;
                pointSeriesLabel1.Angle        = 30;
                pointSeriesLabel1.ResolveOverlappingMinIndent = 10;
                pointSeriesLabel1.ResolveOverlappingMode      = DevExpress.XtraCharts.ResolveOverlappingMode.JustifyAllAroundPoint;
                series.Label = pointSeriesLabel1;
            }
            else if (series.Label is PieSeriesLabel)
            {
                pieSeriesLabel1.LineLength   = 15;
                pieSeriesLabel1.LineVisible  = true;
                pieSeriesLabel1.Antialiasing = true;
                pieSeriesLabel1.ResolveOverlappingMinIndent = 10;
                pieSeriesLabel1.ResolveOverlappingMode      = DevExpress.XtraCharts.ResolveOverlappingMode.JustifyAllAroundPoint;
                series.Label = pieSeriesLabel1;
            }
            else if (series.Label is SideBySideBarSeriesLabel)
            {
                sideBySizeSeriesLabel1.LineLength   = 15;
                sideBySizeSeriesLabel1.LineVisible  = true;
                sideBySizeSeriesLabel1.Antialiasing = true;
                sideBySizeSeriesLabel1.Position     = BarSeriesLabelPosition.Top;
                sideBySizeSeriesLabel1.ResolveOverlappingMinIndent = 10;
                sideBySizeSeriesLabel1.ResolveOverlappingMode      = DevExpress.XtraCharts.ResolveOverlappingMode.JustifyAllAroundPoint;
                series.Label = sideBySizeSeriesLabel1;
            }
            ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(pointSeriesLabel1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(series)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(chartControl1)).EndInit();
            //************************************************************EndInit()********************************************************
        }