소스 검색

修改报告对比效果现实

zhangjiaxin 1 주 전
부모
커밋
c49a15ac53

+ 18 - 32
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.cs

@@ -37,10 +37,6 @@ namespace OTSIncAReportGrids
         frmReportConditionChoose m_condition;
 
         List<int> list_gridheight = new List<int>();
-        //List<DataTable> list_table_data = new List<DataTable>();
-        //List<Point> list_table_size = new List<Point>();
-        //List<Point> list_table_Point = new List<Point>();
-        //List<string> list_fileName = new List<string>();
 
         List<DataTable> list_table_data = new List<DataTable>();
         List<Point> list_table_size = new List<Point>();
@@ -51,13 +47,12 @@ namespace OTSIncAReportGrids
         List<ComboBox> list_ComboBox = new List<ComboBox>();
         List<ChartControl> list_ChartControl = new List<ChartControl>();
 
-        int gridwidth = 0;
+ 
 		int gridhigh = 0;
-		int GridPosition = 0;
-        int chartposition = 0;
-        int indexGraphicType = 0;
-        string GraphicType = "柱状图";
+        int gridwide = 0;
 
+		int chartposition = 0;
+      
         // constants for column names used repeatedly
         private static readonly string ColRowId = "rowid";
         private static readonly string ColTypeName = "TypeName";
@@ -167,7 +162,7 @@ namespace OTSIncAReportGrids
             Point point = SetDataGridViewStyle(gridView);
 
 			list_table_Point.Add(point);
-            gridView.Location = new Point(point.X, point.Y + (DataNumber * 300));
+            gridView.Location = new Point(point.X, 0);
 
 			AddSumRow(gridView);
 
@@ -334,7 +329,7 @@ namespace OTSIncAReportGrids
             {
                 gridView.Rows[sumRowIndex].DefaultCellStyle.BackColor = Color.Azure;
             }
-            //gridView.Rows[sumRowIndex].Height = 30;
+            
             gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30);
         }
 
@@ -378,18 +373,13 @@ namespace OTSIncAReportGrids
 			}
 
 			gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridViewHeight);
-			//gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30);
-
+			
 			int gridheight =  gridViewHeight + 7;
 
 			gridhigh = gridhigh +  gridViewHeight+2;
-
-
-			//gridwidth = gridwidth + gridView.ColumnCount * 100 + 60;
-
-
-            chartposition = chartposition + gridView.ColumnCount * 100;
-            GridPosition = gridView.ColumnCount * 100 + 40;
+			gridwide= gridwide+ gridView.ColumnCount * 100 + 80;
+			chartposition = chartposition + gridView.ColumnCount * 100;
+            
             list_gridheight.Add(gridheight);
 
             gridView.TabIndex = 0;
@@ -404,10 +394,9 @@ namespace OTSIncAReportGrids
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
             gridView.ColumnHeadersHeight = 40;
 
-            list_table_size.Add(new Point(gridView.ColumnCount * 100 + 40, gridViewHeight+30 ));
+            list_table_size.Add(new Point(gridView.ColumnCount * 100 + 40, (gridView.RowCount + 2) * 30));
 
-			//return new Point(gridwidth - (gridView.ColumnCount * 100 + 60), gridheight + 5);
-			return new Point(0, gridhigh-  gridViewHeight-2);
+			return new Point(gridwide-(gridView.ColumnCount * 100 + 80), 0);
 
 		}
 
@@ -430,15 +419,12 @@ namespace OTSIncAReportGrids
                 stdIdIndex = STDIdItm.comboDownList.IndexOf(stdId_TYPE);
             }
 
-            indexGraphicType = stdIdIndex;
-            GraphicType = stdId_TYPE;
-
             int high = 0;
-            for (int i = 0; i < list_table_Point.Count; i++)
+            for (int i = 0; i < list_table_size.Count; i++)
             {
-                if (high < list_table_Point[i].Y)
+                if (high < list_table_size[i].Y)
                 {
-                    high = list_table_Point[i].Y;
+                    high = list_table_size[i].Y;
                 }
             }
 
@@ -478,8 +464,8 @@ namespace OTSIncAReportGrids
             chartControl1.CrosshairOptions.ShowValueLine = true;
             chartControl1.CrosshairOptions.ShowArgumentLabels = true;
             DevFunctions.ChangeView2(chartControl1, comboBox1Text);
-            chartControl1.Location = new Point(a_Location.X+ a_size.X+20, a_Location.Y + 20 + (DataNumber * 300));
-            chartControl1.Size = new Size(a_size.X, a_size.Y);
+            chartControl1.Location = new Point(a_Location.X, location_hig + 20 );
+            chartControl1.Size = new Size(a_size.X, location_hig);
 
             var diagram = chartControl1.Diagram as XYDiagram;
             if (diagram != null)
@@ -498,7 +484,7 @@ namespace OTSIncAReportGrids
             comboBox.Items.AddRange(ChartTypes);
             comboBox.Name = Convert.ToString(list_ComboBox.Count - 1);
             comboBox.SelectedIndex = 0;
-            comboBox.Location = new Point(a_Location.X + a_size.X +20+ chartControl1.Size.Width - 100, a_Location.Y + (DataNumber * 300));
+            comboBox.Location = new Point(a_Location.X + chartControl1.Size.Width - 100, location_hig);
             comboBox.Size = new Size(100, 25);
             comboBox.SelectedIndexChanged += ComboBox_SelectedIndexChanged;
 

+ 4 - 239
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.cs

@@ -48,13 +48,6 @@ namespace OTSIncAReportGrids
         /// </summary>
         public bool ParticleRange { set; get; }
 
-        /// <summary>
-        /// 表数据
-        /// </summary>
-  //      List<DataTable> list_table_data = new List<DataTable>();
-		//List<Point> list_table_size = new List<Point>();
-		//List<Point> list_table_Point = new List<Point>();
-		//List<string> list_fileName = new List<string>();
 		#endregion
 
 
@@ -198,13 +191,11 @@ namespace OTSIncAReportGrids
                 }
             }
 
-            //list_table_data.Add(table_data);
+
             gridView.Name = "gridView" + num.ToString();
             dgv = gridView;
             //设置grid风格
-            //list_table_Point.Add(SetDataGridViewStyle(gridView));
             SetDataGridViewStyle(gridView);
-			//SetDataGridViewStyle(gridView);
 			panel1.Controls.Add(gridView);
         }
 	
@@ -220,9 +211,6 @@ namespace OTSIncAReportGrids
             //用户不能调整 行高
             gridView.AllowUserToResizeRows = false;
 
-            //改变行的高度;
-            //gridView.RowTemplate.Height = 20;
-
             //点击选择整行
             gridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
 
@@ -255,11 +243,10 @@ namespace OTSIncAReportGrids
             gridView.ContextMenuStrip = this.contextMenuStrip1;
             gridView.BorderStyle = 0;
 
-			//int outpos = gridwidth;
 			gridView.Location = new System.Drawing.Point(0, gridheight);
 			gridView.Margin = new System.Windows.Forms.Padding(2);
             gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
-            //gridView.Name = "Gview_gz";
+
             gridView.ReadOnly = true;
             gridView.RowHeadersVisible = false;
             gridView.RowHeadersWidth = 40;
@@ -282,8 +269,6 @@ namespace OTSIncAReportGrids
             //先设置一下头的高度,否则会太矮不好看
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
             gridView.ColumnHeadersHeight = 40;
-			//list_table_size.Add(new Point(gridView.ColumnCount * 100 , gridView.RowCount * 30));
-			//return new Point(0, gridheight);
 		}
         #endregion
 
@@ -329,9 +314,6 @@ namespace OTSIncAReportGrids
             }
             Report = false;
 
-            //list_fileName.Clear();
-
-
 			if (sou.Contains("+"))
             {
                 for (int i = 0; i < sou.Split('+').Length; i++)
@@ -340,8 +322,7 @@ namespace OTSIncAReportGrids
                     if (resultFile != null)
                     {
                         BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName, sel);
-                        //list_fileName.Add(resultFile.anotherFileName);
-
+    
 					}
                 }
             }
@@ -352,226 +333,13 @@ namespace OTSIncAReportGrids
                     if (sou == m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString())
                     {
                         BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName, sel);
-						//list_fileName.Add(m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName);
+						
 					}
                 }
             }
 
         }
 
-		//public void SetGraphicType(ReportCondition sourceGridData)
-		//{
-
-		//	string stdId = "";
-		//	int stdIdIndex = 0;
-		//	//find the stdId condition
-		//	var STDIdItm = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.STD_ID);
-		//	if (STDIdItm != null)
-		//	{
-		//		stdId = STDIdItm.itemDisplayVal.ToString();
-		//		stdIdIndex = STDIdItm.comboDownList.IndexOf(stdId);
-		//	}
-
-		//	string stdId_TYPE = "";
-		//	int stdIdIndex_TYPE = 0;
-		//	//find the stdId condition
-		//	var STDIdItm_TYPE = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.GRAPHIC_TYPE);
-		//	if (STDIdItm_TYPE != null)
-		//	{
-		//		stdId_TYPE = STDIdItm_TYPE.itemDisplayVal.ToString();
-		//		stdIdIndex_TYPE = STDIdItm_TYPE.comboDownList.IndexOf(stdId);
-		//	}
-		//	int high = 0;
-		//	for (int i = 0; i < list_table_Point.Count; i++)
-		//	{
-		//		if (high < list_table_Point[i].Y)
-		//		{
-		//			high = list_table_Point[i].Y;
-		//		}
-		//	}
-
-		//	for (int i = 0; i < list_table_data.Count; i++)
-		//	{
-  //              Graphics(list_table_data[i], list_fileName[i], stdId_TYPE, list_table_size[i], list_table_Point[i], high);
-		//		Graphics_Stacking(list_table_data[i], stdId, list_table_size[i], list_table_Point[i], high+ list_table_size[i].Y);
-		//	}
-
-		//}
-
-		//private void Graphics(DataTable data, string filename, string comboBox1Text,  Point a_size, Point a_Location, int location_hig)
-		//{
-		//	ChartControl chartControl1 = new ChartControl();
-		//	chartControl1.Series.Clear();
-
-		//	// 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
-		//	Series series = new Series(filename, ViewType.Bar);
-		//	for (int a = 0; a < data.Rows.Count; a++)
-		//	{
-		//		string name = data.Rows[a]["TypeName"].ToString();
-		//		double Cunt = Convert.ToDouble(data.Rows[a]["ar"]);
-		//		series.Points.Add(new SeriesPoint(name, Cunt));
-		//	}
-		//	series.LabelsVisibility = DefaultBoolean.True;
-		//	chartControl1.Series.Add(series);
-
-		//	//图例的位置定义
-		//	chartControl1.Legend.AlignmentVertical = LegendAlignmentVertical.Top;
-		//	chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.RightOutside;
-		//	chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
-		//	chartControl1.Legend.Direction = LegendDirection.TopToBottom;
-
-		//	//十字准线光标
-		//	chartControl1.CrosshairEnabled = DefaultBoolean.True;
-		//	chartControl1.CrosshairOptions.ShowValueLine = true;
-		//	chartControl1.CrosshairOptions.ShowArgumentLabels = true;
-		//	DevFunctions.ChangeView2(chartControl1, comboBox1Text);
-		//	chartControl1.Location = new Point(a_Location.X, location_hig);
-		//	chartControl1.Size = new Size(a_size.X, a_size.Y);
-		//	// 获取图表的坐标系(通常为 XYDiagram)
-		//	XYDiagram diagram = chartControl1.Diagram as XYDiagram;
-
-		//	if (diagram != null)
-		//	{
-		//		// 设置横坐标(X轴)名称
-		//		diagram.AxisX.Title.Text = "种类";
-		//		diagram.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True; // 确保标题可见
-
-		//		// 设置纵坐标(Y轴)名称
-		//		diagram.AxisY.Title.Text = "面积";
-		//		diagram.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True; // 确保标题可见
-		//	}
-		//	panel1.Controls.Add(chartControl1);
-		//}
-
-		/// <summary>
-		/// chart图创建
-		/// </summary>
-		/// <param name="dt"></param>
-		/// <param name="stdId"></param>
-		//private void Graphics_Stacking(DataTable dt, string stdId, Point a_size, Point a_Location, int location_hig)
-		//{
-		//	ChartControl chartControl1 = new ChartControl();
-		//	chartControl1.Series.Clear();
-
-		//	chartControl1.Size = new Size(a_size.X, a_size.Y);
-		//	chartControl1.Location = new Point(a_Location.X, location_hig);
-
-		//	DataTable dataTable = new DataTable();
-		//	dataTable.Columns.Add("name");
-		//	dataTable.Columns.Add("size");
-
-		//	if (stdId != "All")
-		//	{
-		//		for (int i = 0; i < dt.Rows.Count; i++)
-		//		{
-		//			if (dt.Rows[i]["TypeName"].ToString() == stdId)
-		//			{
-		//				for (int a = 3; a < dt.Columns.Count; a++)
-		//				{
-		//					DataRow dr = dataTable.NewRow();
-		//					dr["name"] = dt.Columns[a].ColumnName;
-  //                          if (dt.Rows[i][a].ToString() == "")
-  //                          {
-		//						dr["size"] = 0;
-		//					}
-  //                          else
-  //                          {
-		//						dr["size"] = Convert.ToDouble(dt.Rows[i][a]);
-		//					}
-                                
-		//					dataTable.Rows.Add(dr);
-		//				}
-		//			}
-		//		}
-		//	}
-
-		//	if (stdId == "All")
-		//	{
-		//		List<Series> seriesList = new List<Series>();
-
-		//		DataTable data = new DataTable();
-		//		data.Columns.Add("name");
-		//		data.Columns.Add("range");
-		//		data.Columns.Add("num");
-		//		for (int i = 0; i < dt.Rows.Count; i++)
-		//		{
-		//			for (int a = 3; a < dt.Columns.Count; a++)
-		//			{
-		//				DataRow dr = data.NewRow();
-		//				dr["name"] = dt.Rows[i]["TypeName"].ToString();
-		//				dr["range"] = dt.Columns[a].ColumnName;
-  //                      if (dt.Rows[i][a].ToString() == "")
-  //                      {
-		//					dr["num"] = 0;
-		//				}
-  //                      else
-  //                      {
-		//					dr["num"] = dt.Rows[i][a].ToString();
-		//				}
-                            
-		//				data.Rows.Add(dr);
-		//			}
-		//		}
-
-		//		foreach (DataRow dr in data.DefaultView.ToTable(true, "name").Rows)
-		//		{
-		//			Series s = new Series(dr["name"].ToString(), ViewType.StackedBar)
-		//			{
-		//				LegendTextPattern = dr["name"].ToString(),
-		//				ArgumentScaleType = ScaleType.Qualitative,
-		//			};
-		//			foreach (DataRow drl in data.Select("name='" + dr["name"].ToString() + "'"))
-		//				s.Points.Add(new SeriesPoint(drl["range"].ToString(), double.Parse(drl["num"].ToString())));
-		//			s.LabelsVisibility = DefaultBoolean.False;
-		//			seriesList.Add(s);
-		//		}
-		//		foreach (Series sr in seriesList.ToArray())
-		//			chartControl1.Series.Add(sr);
-		//	}
-		//	else
-		//	{
-
-
-
-		//		// 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
-		//		Series series = new Series(stdId, ViewType.Bar);
-
-		//		for (int a = 0; a < dataTable.Rows.Count; a++)
-		//		{
-		//			string name = dataTable.Rows[a]["name"].ToString();
-		//			double Cunt = Convert.ToDouble(dataTable.Rows[a]["size"]);
-		//			series.Points.Add(new SeriesPoint(name, Cunt));
-		//		}
-		//		series.LabelsVisibility = DefaultBoolean.True;
-		//		chartControl1.Series.Add(series);
-
-
-		//	}
-
-
-		//		((XYDiagram)chartControl1.Diagram).AxisY.Title.Text = "";
-		//	((XYDiagram)chartControl1.Diagram).AxisX.Title.Text = "";
-		//	((XYDiagram)chartControl1.Diagram).AxisY.Title.Visibility = DefaultBoolean.True;
-		//	((XYDiagram)chartControl1.Diagram).AxisX.Title.Visibility = DefaultBoolean.True;
-		//	((XYDiagram)chartControl1.Diagram).AxisY.Title.Font = new Font("Tahoma", 9);
-		//	((XYDiagram)chartControl1.Diagram).AxisX.Title.Font = new Font("Tahoma", 9);
-		//	((XYDiagram)chartControl1.Diagram).AxisY.Title.Alignment = System.Drawing.StringAlignment.Far;
-		//	((XYDiagram)chartControl1.Diagram).AxisX.Title.Alignment = System.Drawing.StringAlignment.Far;
-
-		//	//图例的位置定义
-		//	chartControl1.Legend.AlignmentVertical = LegendAlignmentVertical.Top;
-		//	chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.RightOutside;
-		//	chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
-		//	chartControl1.Legend.Direction = LegendDirection.TopToBottom;
-
-		//	//十字准线光标
-		//	chartControl1.CrosshairEnabled = DefaultBoolean.True;
-		//	chartControl1.CrosshairOptions.ShowValueLine = true;
-		//	chartControl1.CrosshairOptions.ShowArgumentLabels = true;
-
-
-		//	panel1.Controls.Add(chartControl1);
-		//}
 		#endregion
 
 		#region 相关事件
@@ -612,9 +380,6 @@ namespace OTSIncAReportGrids
             Gview_gz.Rows.Clear();
             Gview_gz.Columns.Clear();
 
-            //BindDataGridView();
-
-            //SetDataGridViewStyle();
         }
         private void Gview_gz_Sorted(object sender, EventArgs e)
         {

+ 17 - 28
OTSIncAReportApp/1-UI/Control_Grids/ParticlesSizeGrid.cs

@@ -232,7 +232,7 @@ namespace OTSIncAReportGrids
                 }
                 
                 string name = NameList[index];
-                //gridView.Rows[add_rowindex].Cells[1].Value = name;
+         
                 gridView.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
                 gridView.Rows[add_rowindex].Cells[1].Style.BackColor = Color.Azure;
                 string color = "#000000";
@@ -311,8 +311,7 @@ namespace OTSIncAReportGrids
                     }
                 }
             }
-            //gridView.Rows[a1].Height = 30;
-
+         
             gridView.Rows[a1].DefaultCellStyle.BackColor = Color.Azure;
             gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30);
         }
@@ -327,9 +326,6 @@ namespace OTSIncAReportGrids
             //用户不能调整 行高
             gridView.AllowUserToResizeRows = false;
 
-            //改变行的高度;
-            //gridView.RowTemplate.Height = 20;
-
             //点击选择整行
             gridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
 
@@ -362,8 +358,6 @@ namespace OTSIncAReportGrids
             gridView.ContextMenuStrip = this.contextMenuStrip1;
             gridView.BorderStyle = 0;
 
-			
-
 			gridView.Margin = new System.Windows.Forms.Padding(2);
             gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
 
@@ -371,16 +365,16 @@ namespace OTSIncAReportGrids
             gridView.RowHeadersVisible = false;
             gridView.RowHeadersWidth = 40;
             gridView.RowTemplate.Height = 30;
-            //gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
+
             int gridView_Width = 0;
 
-			for (int i = 0; i < gridView.ColumnCount; i++)
+            for (int i = 0; i < gridView.ColumnCount; i++)
             {
                 gridView_Width = gridView_Width + gridView.Columns[i].Width;
 
-			}
+            }
 
-			int gridViewHeight = 0;
+            int gridViewHeight = 0;
 
 			for (int i = 0; i < gridView.Rows.Count; i++)
 			{
@@ -390,10 +384,8 @@ namespace OTSIncAReportGrids
 
 			gridView.Size = new System.Drawing.Size(gridView_Width, gridViewHeight);
 			
-
-			//gridView.Size = new System.Drawing.Size(gridView_Width, gridView.RowCount * 30);
             gridheight = gridheight + gridViewHeight;
-            gridwidth = gridwidth + gridView.ColumnCount * 100;
+            gridwidth = gridwidth + gridView_Width+20;
 			gridView.TabIndex = 0;
             //先设置一下头的高度,否则会太矮不好看
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
@@ -401,14 +393,14 @@ namespace OTSIncAReportGrids
 
             gridView.Columns[4].Visible = false;
 
-			list_table_size.Add(new Point(gridView.ColumnCount * 100 - 40, gridViewHeight+30));
+			list_table_size.Add(new Point(gridView_Width, (gridView.RowCount + 2) * 30));
             int outpos = gridView.Location.X;
             int a_height = gridheight - gridViewHeight;
 
 
-			gridView.Location = new System.Drawing.Point(gridwidth- gridView.ColumnCount * 100, 0);
-			return new Point(outpos, a_height);
-            //list_table_Point.Add(new Point(gridwidth, gridheight));
+			gridView.Location = new System.Drawing.Point(gridwidth- (gridView_Width + 20), 0);
+			return new Point(gridwidth - (gridView_Width + 20), 0);
+          
         }
         #endregion
 
@@ -477,7 +469,7 @@ namespace OTSIncAReportGrids
 
 			string stdId = "";
 			int stdIdIndex = 0;
-			//find the stdId condition
+	
 			var STDIdItm = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.STD_ID);
 			if (STDIdItm != null)
 			{
@@ -485,11 +477,11 @@ namespace OTSIncAReportGrids
 				stdIdIndex = STDIdItm.comboDownList.IndexOf(stdId); 
 			}
             int high = 0;
-            for (int i = 0; i < list_table_Point.Count; i++)
+            for (int i = 0; i < list_table_size.Count; i++)
             {
-                if (high < list_table_Point[i].Y)
+                if (high < list_table_size[i].Y)
                 {
-					high = list_table_Point[i].Y;
+					high = list_table_size[i].Y;
 				}
             }
 
@@ -512,8 +504,8 @@ namespace OTSIncAReportGrids
 			ChartControl chartControl1 = new ChartControl();
 			chartControl1.Series.Clear();
 
-            chartControl1.Size = new Size(a_size.X, a_size.Y);
-            chartControl1.Location = new Point(a_Location.X+ a_size.X+20, a_size.Y+20);
+            chartControl1.Size = new Size(a_size.X, location_hig);
+            chartControl1.Location = new Point(a_Location.X, location_hig + 20);
 
 			DataTable dataTable = new DataTable();
 			dataTable.Columns.Add("name");
@@ -577,9 +569,6 @@ namespace OTSIncAReportGrids
 			}
 			else
 			{
-
-
-
 				// 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
 				Series series = new Series(stdId, ViewType.Bar);