Ver código fonte

Merge branch 'cxs' of http://36.129.169.60:30080/gogsadmin/OTS into cxs

Conflicts:
#	OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs
cxs 3 meses atrás
pai
commit
8cc400adcc

+ 2 - 2
Bin/x64/Debug/Config/ProData/HardwareConfig.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData PathName="HardwareConfig.xml" ID="1">
-  <Member RegName="SemControllerName" Value="Bruker" ImageInputSources="SE" />
-  <Member RegName="EDSName" Value="Bruker" WeightPercentageToAtomicPercentage="false" />
+  <Member RegName="SemControllerName" Value="OffLine" ImageInputSources="SE" />
+  <Member RegName="EDSName" Value="OffLine" WeightPercentageToAtomicPercentage="false" />
   <Member RegName="BrukerDllVersion" Version="Bruker.API.Esprit64.dll" />
   <Member RegName="FEIIP" Value="192.168.0.1" />
   <Member RegName="FEIPORT" Value="7520" />

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -1782,7 +1782,7 @@
  <Form>
     <Name>SlopFocus</Name>
     <Controls>
-	  <Control name="SlopFocus" text="是否启用" />
+	  <Control name="SlopFocus" text="斜面聚焦" />
       <Control name="cB_enable" text="是否启用" />
 	  <Control name="groupBox1" text="第一点" />
 	  <Control name="label8" text="工作距离" />

+ 149 - 51
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.cs

@@ -1,5 +1,10 @@
-using OTSCommon.DBOperate.Model;
+using DevExpress.Utils;
+using DevExpress.XtraCharts;
+using DevExpress.XtraRichEdit.Layout;
+using DevExpress.XtraTreeList.Data;
+using OTSCommon.DBOperate.Model;
 using OTSIncAReportApp;
+using OTSIncAReportApp._1_UI.Control_DEVCharts;
 using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportApp.OTSRstMgrFunction;
 using OTSIncAReportApp.OTSSampleReportInfo;
@@ -10,6 +15,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Data;
 using System.Drawing;
+using System.Linq;
 using System.Windows.Forms;
 
 namespace OTSIncAReportGrids
@@ -43,14 +49,21 @@ namespace OTSIncAReportGrids
 
         frmReportConditionChoose m_condition;
 
-        int gridheight = 0;
-        #endregion
-
-        #region 多数据源
-        /// <summary>
-        /// 绑定datagridview数据
-        /// </summary>
-        public void BindDataGridView(string path, int num, string filename)
+        //int gridheight = 0;
+        List<int> list_gridheight = new List<int>();
+
+		int gridwidth = 0;
+        int GridPosition = 0;
+        int chartposition = 0;
+		int indexGraphicType = 0;
+        string GraphicType = "柱状图";
+		#endregion
+
+		#region 多数据源
+		/// <summary>
+		/// 绑定datagridview数据
+		/// </summary>
+		public void BindDataGridView(string path, int num, string filename,string GraphicType)
         {
             List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
             List<string> NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
@@ -258,15 +271,68 @@ namespace OTSIncAReportGrids
                     gridView.Rows[a1].Cells[4].Value = 0;
                 gridView.Rows[a1].Cells[4].Value = Convert.ToDouble(gridView.Rows[a1].Cells[4].Value) + Convert.ToDouble(gridView.Rows[j].Cells[4].Value);
             }
-            SetDataGridViewStyle(gridView);
+           int position=  SetDataGridViewStyle(gridView);
             panel1.Controls.Add(gridView);
 
-        }
+   //         Panel panel = new Panel();
+			//panel.Size = new Size(gridwidth, 27);
+			////panel.Dock = DockStyle.Top;
+			//panel.Location=new Point(0, list_gridheight.Max());
+   //         panel.BackColor = Color.WhiteSmoke;
+           
+            Graphics(dt, filename, GraphicType, position);
+
+		}
+
+        private void Graphics(DataTable data,string filename,string comboBox1Text,int pos)
+        {
+            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]["con"]);
+                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(pos, list_gridheight.Max());
+            chartControl1.Size = new Size(GridPosition, GridPosition);
+			// 获取图表的坐标系(通常为 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>
         /// 设置DataGridView样式
         /// </summary>
-        private void SetDataGridViewStyle(OTSGridView gridView)
+        private int  SetDataGridViewStyle(OTSGridView gridView)
         {
             //用户不能调整标题的高度
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
@@ -311,8 +377,13 @@ namespace OTSIncAReportGrids
 
             //gridView.Dock = System.Windows.Forms.DockStyle.Fill;
             //gridView.Location = new System.Drawing.Point(0, 0);
-            gridView.Location = new System.Drawing.Point(0, gridheight);
-            gridView.Margin = new System.Windows.Forms.Padding(2);
+            //gridView.Location = new System.Drawing.Point(0, gridheight);
+            int gridheight = 0;
+            //chartposition = gridwidth;
+            int outpos = gridwidth;
+			gridView.Location = new System.Drawing.Point(gridwidth, 0);
+
+			gridView.Margin = new System.Windows.Forms.Padding(2);
             gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
             //gridView.Name = "Gview_gz";
             gridView.ReadOnly = true;
@@ -320,9 +391,16 @@ namespace OTSIncAReportGrids
             gridView.RowHeadersWidth = 40;
             gridView.RowTemplate.Height = 30;
             //gridView.Size = new System.Drawing.Size(667, 520);
-            gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
-            gridheight = gridheight + gridView.RowCount * 30 + 80;
-            gridView.TabIndex = 0;
+            gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30);
+			//gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
+			//gridheight = gridheight + gridView.RowCount * 30 + 80;
+			gridheight = gridheight + gridView.RowCount * 30 + 5;
+			gridwidth = gridwidth + gridView.ColumnCount * 100 + 60;
+            chartposition = chartposition + gridView.ColumnCount * 100;
+			GridPosition = gridView.ColumnCount * 100 +40;
+			list_gridheight.Add(gridheight);
+
+			gridView.TabIndex = 0;
             gridView.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.Gview_gz_SortCompare);
             gridView.Sorted += new System.EventHandler(this.Gview_gz_Sorted);
 
@@ -330,7 +408,8 @@ namespace OTSIncAReportGrids
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
             gridView.ColumnHeadersHeight = 40;
 
-        }
+            return outpos;
+		}
         #endregion
 
         #region 窗体加载及初始化
@@ -355,38 +434,57 @@ namespace OTSIncAReportGrids
             table = lan.GetNameTable(this.Name);
         }
 
-        private void CompositionDistributionGrid_Load(object sender, EventArgs e)
+        public void SetGraphicType(ReportCondition sourceGridData)
         {
-            //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
-            //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
-            string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
-
-            //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
-            if (sou.Contains("+"))
-            {
-                for (int i = 0; i < sou.Split('+').Length; i++)
-                {
-                    ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
-                    if (resultFile != null)
-                    {
-                        BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName);
-                    }
-                }
-            }
-            else
-            {
-                for (int i=0;i< m_ReportApp.m_rstDataMgr.ResultFilesList.Count;i++)
-                {
-                    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);
-                    }
-                }
-
-                //BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
-                ////设置grid风格
-                //SetDataGridViewStyle();
-            }
+			string stdId = "";
+			int stdIdIndex = 0;
+			//find the stdId condition
+			var STDIdItm = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.GRAPHIC_TYPE);
+			if (STDIdItm != null)
+			{
+				stdId = STDIdItm.itemDisplayVal.ToString();
+				stdIdIndex = STDIdItm.comboDownList.IndexOf(stdId);
+			}
+
+            indexGraphicType = stdIdIndex;
+            GraphicType = stdId;
+
+			//int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+			//string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+			string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+
+			//string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+			if (sou.Contains("+"))
+			{
+				for (int i = 0; i < sou.Split('+').Length; i++)
+				{
+					ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
+					if (resultFile != null)
+					{
+						BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName, stdId);
+					}
+				}
+			}
+			else
+			{
+				for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
+				{
+					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, stdId);
+					}
+				}
+
+				//BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
+				////设置grid风格
+				//SetDataGridViewStyle();
+			}
+		}
+
+
+		private void CompositionDistributionGrid_Load(object sender, EventArgs e)
+        {
+    
         }
         #endregion
 
@@ -464,13 +562,13 @@ namespace OTSIncAReportGrids
                     ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
                     if (resultFile != null)
                     {
-                        BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName);
+                        BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName, GraphicType);
                     }
                 }
             }
             else
             {
-                BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].anotherFileName);
+                BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].anotherFileName, GraphicType);
             }
         }
 

+ 86 - 85
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.designer.cs

@@ -28,94 +28,95 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CompositionDistributionGrid));
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
-            this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
-            this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
-            this.panel1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
-            this.contextMenuStrip1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // panel1
-            // 
-            this.panel1.AutoScroll = true;
-            this.panel1.Controls.Add(this.pictureBox1);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.panel1.Location = new System.Drawing.Point(0, 0);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1000, 780);
-            this.panel1.TabIndex = 5;
-            // 
-            // pictureBox1
-            // 
-            this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
-            this.pictureBox1.Location = new System.Drawing.Point(746, 735);
-            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
-            this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(255, 45);
-            this.pictureBox1.TabIndex = 1;
-            this.pictureBox1.TabStop = false;
-            // 
-            // contextMenuStrip1
-            // 
-            this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
-            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+			this.components = new System.ComponentModel.Container();
+			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CompositionDistributionGrid));
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.pictureBox1 = new System.Windows.Forms.PictureBox();
+			this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+			this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+			this.ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
+			this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+			this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
+			this.panel1.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+			this.contextMenuStrip1.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// panel1
+			// 
+			this.panel1.AutoScroll = true;
+			this.panel1.Controls.Add(this.pictureBox1);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.panel1.Location = new System.Drawing.Point(0, 0);
+			this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(667, 520);
+			this.panel1.TabIndex = 5;
+			// 
+			// pictureBox1
+			// 
+			this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
+			this.pictureBox1.Location = new System.Drawing.Point(497, 490);
+			this.pictureBox1.Name = "pictureBox1";
+			this.pictureBox1.Size = new System.Drawing.Size(170, 30);
+			this.pictureBox1.TabIndex = 1;
+			this.pictureBox1.TabStop = false;
+			// 
+			// contextMenuStrip1
+			// 
+			this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
+			this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.ToolStripMenuItem1,
             this.ToolStripMenuItem2,
             this.toolStripSeparator1,
             this.ToolStripMenuItem3});
-            this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(215, 100);
-            // 
-            // ToolStripMenuItem1
-            // 
-            this.ToolStripMenuItem1.Image = global::OTSIncAReportApp.Properties.Resources.复制;
-            this.ToolStripMenuItem1.Name = "ToolStripMenuItem1";
-            this.ToolStripMenuItem1.Size = new System.Drawing.Size(214, 30);
-            this.ToolStripMenuItem1.Text = "复制整个表";
-            this.ToolStripMenuItem1.Click += new System.EventHandler(this.ToolStripMenuItem1_Click);
-            // 
-            // ToolStripMenuItem2
-            // 
-            this.ToolStripMenuItem2.Image = global::OTSIncAReportApp.Properties.Resources.复制全部;
-            this.ToolStripMenuItem2.Name = "ToolStripMenuItem2";
-            this.ToolStripMenuItem2.Size = new System.Drawing.Size(214, 30);
-            this.ToolStripMenuItem2.Text = "复制选择区域";
-            this.ToolStripMenuItem2.Click += new System.EventHandler(this.ToolStripMenuItem2_Click);
-            // 
-            // toolStripSeparator1
-            // 
-            this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(211, 6);
-            // 
-            // ToolStripMenuItem3
-            // 
-            this.ToolStripMenuItem3.Image = global::OTSIncAReportApp.Properties.Resources.恢复;
-            this.ToolStripMenuItem3.Name = "ToolStripMenuItem3";
-            this.ToolStripMenuItem3.Size = new System.Drawing.Size(214, 30);
-            this.ToolStripMenuItem3.Text = "恢复至初始状态";
-            this.ToolStripMenuItem3.Click += new System.EventHandler(this.ToolStripMenuItem3_Click);
-            // 
-            // CompositionDistributionGrid
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.SystemColors.ButtonHighlight;
-            this.Controls.Add(this.panel1);
-            this.Name = "CompositionDistributionGrid";
-            this.Size = new System.Drawing.Size(1000, 780);
-            this.Load += new System.EventHandler(this.CompositionDistributionGrid_Load);
-            this.panel1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
-            this.contextMenuStrip1.ResumeLayout(false);
-            this.ResumeLayout(false);
+			this.contextMenuStrip1.Name = "contextMenuStrip1";
+			this.contextMenuStrip1.Size = new System.Drawing.Size(169, 100);
+			// 
+			// ToolStripMenuItem1
+			// 
+			this.ToolStripMenuItem1.Image = global::OTSIncAReportApp.Properties.Resources.复制;
+			this.ToolStripMenuItem1.Name = "ToolStripMenuItem1";
+			this.ToolStripMenuItem1.Size = new System.Drawing.Size(168, 30);
+			this.ToolStripMenuItem1.Text = "复制整个表";
+			this.ToolStripMenuItem1.Click += new System.EventHandler(this.ToolStripMenuItem1_Click);
+			// 
+			// ToolStripMenuItem2
+			// 
+			this.ToolStripMenuItem2.Image = global::OTSIncAReportApp.Properties.Resources.复制全部;
+			this.ToolStripMenuItem2.Name = "ToolStripMenuItem2";
+			this.ToolStripMenuItem2.Size = new System.Drawing.Size(168, 30);
+			this.ToolStripMenuItem2.Text = "复制选择区域";
+			this.ToolStripMenuItem2.Click += new System.EventHandler(this.ToolStripMenuItem2_Click);
+			// 
+			// toolStripSeparator1
+			// 
+			this.toolStripSeparator1.Name = "toolStripSeparator1";
+			this.toolStripSeparator1.Size = new System.Drawing.Size(165, 6);
+			// 
+			// ToolStripMenuItem3
+			// 
+			this.ToolStripMenuItem3.Image = global::OTSIncAReportApp.Properties.Resources.恢复;
+			this.ToolStripMenuItem3.Name = "ToolStripMenuItem3";
+			this.ToolStripMenuItem3.Size = new System.Drawing.Size(168, 30);
+			this.ToolStripMenuItem3.Text = "恢复至初始状态";
+			this.ToolStripMenuItem3.Click += new System.EventHandler(this.ToolStripMenuItem3_Click);
+			// 
+			// CompositionDistributionGrid
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.BackColor = System.Drawing.SystemColors.ButtonHighlight;
+			this.Controls.Add(this.panel1);
+			this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+			this.Name = "CompositionDistributionGrid";
+			this.Size = new System.Drawing.Size(667, 520);
+			this.Load += new System.EventHandler(this.CompositionDistributionGrid_Load);
+			this.panel1.ResumeLayout(false);
+			((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+			this.contextMenuStrip1.ResumeLayout(false);
+			this.ResumeLayout(false);
 
         }
 
@@ -128,5 +129,5 @@
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem3;
         private System.Windows.Forms.PictureBox pictureBox1;
-    }
+	}
 }

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.resx

@@ -121,7 +121,7 @@
   <data name="pictureBox1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAKoAAAAfCAYAAAB3cVZEAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        wwAADsMBx2+oZAAABhBJREFUeF7tmI1NZDEMhGmBGmiBHiiBGmiBDuiADqiACmiABuiAHvb0oTU3O2s7
+        wgAADsIBFShKgAAABhBJREFUeF7tmI1NZDEMhGmBGmiBHiiBGmiBDuiADqiACmiABuiAHvb0oTU3O2s7
         eYvQ3ZMykgW8OI5/xk7urg4LCzvAIurCr+Lt7e3w+Ph4uLu7O1xdXZ3I7e3t4eHh4UtnhEXUhV8B5Lu5
         uTkjZyUQ+f39/bj7HEOifnx8pB1xfX399e35+fnw+fl51D4Ha53DdBX2OUeB05n+SJ6eno4W/gIf8BN/
         8Vv1+Zad77i/vz/ZxySoQJFCj/MuBXY4hxzp2eQTf15eXo6ap/AYZ4Q8KDRnrkeOu5qTT90zK/hd1aEk

+ 310 - 39
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.cs

@@ -1,5 +1,8 @@
 
+using DevExpress.Utils;
+using DevExpress.XtraCharts;
 using OTSIncAReportApp;
+using OTSIncAReportApp._1_UI.Control_DEVCharts;
 using OTSIncAReportApp.OTSRstMgrFunction;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
@@ -38,20 +41,29 @@ namespace OTSIncAReportGrids
         frmReportConditionChoose m_condition;
         private ResultDataMgr m_DataMgr;
         int gridheight = 0;
-        public bool Report { set; get; }
+		int gridwidth = 0;
+		public bool Report { set; get; }
         /// <summary>
         /// 全部颗粒为true选择颗粒为false
         /// </summary>
         public bool ParticleRange { set; get; }
-        #endregion
-
-
 
-        #region 自定义方法
         /// <summary>
-        /// 绑定datagridview数据
+        /// 表数据
         /// </summary>
-        public void BindDataGridView(string path, int num, string filename,int sel)
+        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
+
+
+
+		#region 自定义方法
+		/// <summary>
+		/// 绑定datagridview数据
+		/// </summary>
+		public void BindDataGridView(string path, int num, string filename,int sel)
         {
             List<string> colid = new List<string>() { "rowid", "pname", "area", "con" };
             List<string> colname = new List<string>() { table["str1"].ToString(), table["str4"].ToString(), table["str3"].ToString(), table["str6"].ToString() };
@@ -62,13 +74,21 @@ namespace OTSIncAReportGrids
                 gridView.Columns.Add(colid[i], colname[i]);
             }
             DataTable dte = particledata.GetAllElement();
-            foreach (DataRow item in dte.Rows)
+
+            DataTable table_data = new DataTable();
+
+            table_data.Columns.Add("TypeName");
+			table_data.Columns.Add("con");
+			table_data.Columns.Add("ar");
+			foreach (DataRow item in dte.Rows)
             {
                 DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
                 iconColumn.Name = item["name"].ToString();
                 iconColumn.HeaderText = item["name"].ToString();
                 gridView.Columns.Add(iconColumn);
-            }
+                table_data.Columns.Add(item["name"].ToString());
+
+			}
             List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
             List<string> NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
 
@@ -84,7 +104,8 @@ namespace OTSIncAReportGrids
                 {
                     continue;
                 }
-                double total = Convert.ToDouble(dt.Rows[i]["ar"]);
+				
+				double total = Convert.ToDouble(dt.Rows[i]["ar"]);
                 int add_rowindex = gridView.Rows.Add();
                 gridView.Rows[add_rowindex].Cells[0].Value = add_rowindex + 1;
                 gridView.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
@@ -95,7 +116,12 @@ namespace OTSIncAReportGrids
                 gridView.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
                 DataTable dtp = particledata.GetAreaByIncA(dt.Rows[i]["TypeId"].ToString(), filedAndParticl);
 
-                for (int j = 4; j < gridView.Columns.Count; j++)
+				DataRow row1 = table_data.NewRow();
+				row1["TypeName"] = dt.Rows[i]["TypeName"];
+				row1["con"] = dt.Rows[i]["con"];
+                row1["ar"] = Math.Round(total, 2);
+
+				for (int j = 4; j < gridView.Columns.Count; j++)
                 {
                     int col = 0;
                     foreach (DataRow dr in dtp.Rows)
@@ -106,7 +132,10 @@ namespace OTSIncAReportGrids
                             double p = Math.Round(ar / total, 2);
                             gridView.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap((float)p, Color.Azure);
                             gridView.Rows[add_rowindex].Cells[j].Tag = p;
-                            break;
+
+
+							row1[gridView.Columns[j].Name] = p;
+							break;
                         }
                         col++;
                     }
@@ -116,7 +145,10 @@ namespace OTSIncAReportGrids
                         gridView.Rows[add_rowindex].Cells[j].Tag = 0;
                     }
                 }
-            }
+
+                table_data.Rows.Add(row1);
+
+			}
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 if (Convert.ToInt32(dt.Rows[i]["TypeId"]) > 100)
@@ -139,7 +171,9 @@ namespace OTSIncAReportGrids
                 gridView.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
                 gridView.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
                 DataTable dtp = particledata.GetAreaByIncA(dt.Rows[i]["TypeId"].ToString(), filedAndParticl);
-                for (int j = 4; j < gridView.Columns.Count; j++)
+				
+
+				for (int j = 4; j < gridView.Columns.Count; j++)
                 {
                     int col = 0;
                     foreach (DataRow dr in dtp.Rows)
@@ -151,7 +185,9 @@ namespace OTSIncAReportGrids
                             double p = Math.Round(ar / total, 2);
                             gridView.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap((float)p, Color.Azure);
                             gridView.Rows[add_rowindex].Cells[j].Tag = p;
-                            break;
+
+							
+							break;
                         }
                         col++;
                     }
@@ -162,17 +198,20 @@ namespace OTSIncAReportGrids
                     }
                 }
             }
+
+            list_table_data.Add(table_data);
             gridView.Name = "gridView" + num.ToString();
             dgv = gridView;
-            //设置grid风格
-            SetDataGridViewStyle(gridView);
+			//设置grid风格
+			list_table_Point.Add(SetDataGridViewStyle(gridView));
+			//SetDataGridViewStyle(gridView);
             panel1.Controls.Add(gridView);
         }
-
-        /// <summary>
-        /// 设置DataGridView样式
-        /// </summary>
-        private void SetDataGridViewStyle(OTSGridView gridView)
+	
+		/// <summary>
+		/// 设置DataGridView样式
+		/// </summary>
+		private Point SetDataGridViewStyle(OTSGridView gridView)
         {
 
             //用户不能调整标题的高度
@@ -216,28 +255,42 @@ namespace OTSIncAReportGrids
             gridView.ContextMenuStrip = this.contextMenuStrip1;
             gridView.BorderStyle = 0;
 
-            //gridView.Dock = System.Windows.Forms.DockStyle.Fill;
-            //gridView.Location = new System.Drawing.Point(0, 0);
-            gridView.Location = new System.Drawing.Point(0, gridheight);
-            gridView.Margin = new System.Windows.Forms.Padding(2);
+			//gridView.Dock = System.Windows.Forms.DockStyle.Fill;
+			//gridView.Location = new System.Drawing.Point(0, 0);
+			int outpos = gridwidth;
+			//gridView.Location = new System.Drawing.Point(0, gridheight);
+			gridView.Location = new System.Drawing.Point(gridwidth, 0);
+			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;
             gridView.RowTemplate.Height = 30;
-            //gridView.Size = new System.Drawing.Size(667, 520);
-            gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
-            gridheight = gridheight + gridView.RowCount * 30 + 80;
-            gridView.TabIndex = 0;
+
+			int gridView_Width = 0;
+
+			for (int i = 0; i < gridView.ColumnCount; i++)
+			{
+				gridView_Width = gridView_Width + gridView.Columns[i].Width;
+
+			}
+			//gridView.Size = new System.Drawing.Size(667, 520);
+			//gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
+			gridView.Size = new System.Drawing.Size(gridView_Width+60, gridView.RowCount * 30);
+			//gridheight = gridheight + gridView.RowCount * 30 + 80;
+			gridheight = gridheight + gridView.RowCount * 30 + 5;
+			gridwidth = gridwidth + gridView.ColumnCount * 100;
+			gridView.TabIndex = 0;
             gridView.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.Gview_gz_SortCompare);
             gridView.Sorted += new System.EventHandler(this.Gview_gz_Sorted);
 
             //先设置一下头的高度,否则会太矮不好看
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
             gridView.ColumnHeadersHeight = 40;
-
-        }
+			list_table_size.Add(new Point(gridView.ColumnCount * 100 , gridView.RowCount * 30));
+			return new Point(outpos, gridheight);
+		}
         #endregion
 
         #region 初始化构造函数
@@ -283,9 +336,10 @@ namespace OTSIncAReportGrids
             Report = false;
 
             //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
-            
+            list_fileName.Clear();
+
 
-            if (sou.Contains("+"))
+			if (sou.Contains("+"))
             {
                 for (int i = 0; i < sou.Split('+').Length; i++)
                 {
@@ -293,7 +347,9 @@ namespace OTSIncAReportGrids
                     if (resultFile != null)
                     {
                         BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName, sel);
-                    }
+                        list_fileName.Add(resultFile.anotherFileName);
+
+					}
                 }
             }
             else
@@ -303,7 +359,8 @@ 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);
+					}
                 }
 
                 //BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
@@ -321,10 +378,224 @@ namespace OTSIncAReportGrids
             ////设置grid风格
             //SetDataGridViewStyle();
         }
-        #endregion
 
-        #region 相关事件
-        private void ToolStripMenuItem1_Click(object sender, EventArgs e)
+		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 相关事件
+		private void ToolStripMenuItem1_Click(object sender, EventArgs e)
         {
             //复制整个表
             CopyAll();

+ 98 - 97
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.designer.cs

@@ -28,107 +28,108 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ElementCompositionAvgGrid));
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
-            this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
-            this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
-            this.pictureBox2 = new System.Windows.Forms.PictureBox();
-            this.panel1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
-            this.contextMenuStrip1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // panel1
-            // 
-            this.panel1.AutoScroll = true;
-            this.panel1.Controls.Add(this.pictureBox2);
-            this.panel1.Controls.Add(this.pictureBox1);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.panel1.Location = new System.Drawing.Point(0, 0);
-            this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(667, 520);
-            this.panel1.TabIndex = 5;
-            // 
-            // pictureBox1
-            // 
-            this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
-            this.pictureBox1.Location = new System.Drawing.Point(1202, 791);
-            this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(169, 32);
-            this.pictureBox1.TabIndex = 1;
-            this.pictureBox1.TabStop = false;
-            // 
-            // contextMenuStrip1
-            // 
-            this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
-            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+			this.components = new System.ComponentModel.Container();
+			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ElementCompositionAvgGrid));
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.pictureBox2 = new System.Windows.Forms.PictureBox();
+			this.pictureBox1 = new System.Windows.Forms.PictureBox();
+			this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+			this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+			this.ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
+			this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+			this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
+			this.panel1.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+			((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+			this.contextMenuStrip1.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// panel1
+			// 
+			this.panel1.AutoScroll = true;
+			this.panel1.Controls.Add(this.pictureBox2);
+			this.panel1.Controls.Add(this.pictureBox1);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.panel1.Location = new System.Drawing.Point(0, 0);
+			this.panel1.Margin = new System.Windows.Forms.Padding(2);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(667, 520);
+			this.panel1.TabIndex = 5;
+			// 
+			// pictureBox2
+			// 
+			this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.pictureBox2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.BackgroundImage")));
+			this.pictureBox2.Location = new System.Drawing.Point(1902, 1093);
+			this.pictureBox2.Name = "pictureBox2";
+			this.pictureBox2.Size = new System.Drawing.Size(170, 30);
+			this.pictureBox2.TabIndex = 2;
+			this.pictureBox2.TabStop = false;
+			// 
+			// pictureBox1
+			// 
+			this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
+			this.pictureBox1.Location = new System.Drawing.Point(1202, 791);
+			this.pictureBox1.Name = "pictureBox1";
+			this.pictureBox1.Size = new System.Drawing.Size(169, 32);
+			this.pictureBox1.TabIndex = 1;
+			this.pictureBox1.TabStop = false;
+			this.pictureBox1.Visible = false;
+			// 
+			// contextMenuStrip1
+			// 
+			this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
+			this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.ToolStripMenuItem1,
             this.ToolStripMenuItem2,
             this.toolStripSeparator1,
             this.ToolStripMenuItem3});
-            this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(169, 100);
-            // 
-            // ToolStripMenuItem1
-            // 
-            this.ToolStripMenuItem1.Image = global::OTSIncAReportApp.Properties.Resources.复制;
-            this.ToolStripMenuItem1.Name = "ToolStripMenuItem1";
-            this.ToolStripMenuItem1.Size = new System.Drawing.Size(168, 30);
-            this.ToolStripMenuItem1.Text = "复制整个表";
-            this.ToolStripMenuItem1.Click += new System.EventHandler(this.ToolStripMenuItem1_Click);
-            // 
-            // ToolStripMenuItem2
-            // 
-            this.ToolStripMenuItem2.Image = global::OTSIncAReportApp.Properties.Resources.复制全部;
-            this.ToolStripMenuItem2.Name = "ToolStripMenuItem2";
-            this.ToolStripMenuItem2.Size = new System.Drawing.Size(168, 30);
-            this.ToolStripMenuItem2.Text = "复制选择区域";
-            this.ToolStripMenuItem2.Click += new System.EventHandler(this.ToolStripMenuItem2_Click);
-            // 
-            // toolStripSeparator1
-            // 
-            this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(165, 6);
-            // 
-            // ToolStripMenuItem3
-            // 
-            this.ToolStripMenuItem3.Image = global::OTSIncAReportApp.Properties.Resources.恢复;
-            this.ToolStripMenuItem3.Name = "ToolStripMenuItem3";
-            this.ToolStripMenuItem3.Size = new System.Drawing.Size(168, 30);
-            this.ToolStripMenuItem3.Text = "恢复至初始状态";
-            this.ToolStripMenuItem3.Click += new System.EventHandler(this.ToolStripMenuItem3_Click);
-            // 
-            // pictureBox2
-            // 
-            this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.pictureBox2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.BackgroundImage")));
-            this.pictureBox2.Location = new System.Drawing.Point(1198, 790);
-            this.pictureBox2.Name = "pictureBox2";
-            this.pictureBox2.Size = new System.Drawing.Size(170, 30);
-            this.pictureBox2.TabIndex = 2;
-            this.pictureBox2.TabStop = false;
-            // 
-            // ElementCompositionAvgGrid
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Controls.Add(this.panel1);
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.Name = "ElementCompositionAvgGrid";
-            this.Size = new System.Drawing.Size(667, 520);
-            this.Load += new System.EventHandler(this.ElementContentGrid_Load);
-            this.panel1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
-            this.contextMenuStrip1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
-            this.ResumeLayout(false);
+			this.contextMenuStrip1.Name = "contextMenuStrip1";
+			this.contextMenuStrip1.Size = new System.Drawing.Size(169, 100);
+			// 
+			// ToolStripMenuItem1
+			// 
+			this.ToolStripMenuItem1.Image = global::OTSIncAReportApp.Properties.Resources.复制;
+			this.ToolStripMenuItem1.Name = "ToolStripMenuItem1";
+			this.ToolStripMenuItem1.Size = new System.Drawing.Size(168, 30);
+			this.ToolStripMenuItem1.Text = "复制整个表";
+			this.ToolStripMenuItem1.Click += new System.EventHandler(this.ToolStripMenuItem1_Click);
+			// 
+			// ToolStripMenuItem2
+			// 
+			this.ToolStripMenuItem2.Image = global::OTSIncAReportApp.Properties.Resources.复制全部;
+			this.ToolStripMenuItem2.Name = "ToolStripMenuItem2";
+			this.ToolStripMenuItem2.Size = new System.Drawing.Size(168, 30);
+			this.ToolStripMenuItem2.Text = "复制选择区域";
+			this.ToolStripMenuItem2.Click += new System.EventHandler(this.ToolStripMenuItem2_Click);
+			// 
+			// toolStripSeparator1
+			// 
+			this.toolStripSeparator1.Name = "toolStripSeparator1";
+			this.toolStripSeparator1.Size = new System.Drawing.Size(165, 6);
+			// 
+			// ToolStripMenuItem3
+			// 
+			this.ToolStripMenuItem3.Image = global::OTSIncAReportApp.Properties.Resources.恢复;
+			this.ToolStripMenuItem3.Name = "ToolStripMenuItem3";
+			this.ToolStripMenuItem3.Size = new System.Drawing.Size(168, 30);
+			this.ToolStripMenuItem3.Text = "恢复至初始状态";
+			this.ToolStripMenuItem3.Click += new System.EventHandler(this.ToolStripMenuItem3_Click);
+			// 
+			// ElementCompositionAvgGrid
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.Controls.Add(this.panel1);
+			this.Margin = new System.Windows.Forms.Padding(2);
+			this.Name = "ElementCompositionAvgGrid";
+			this.Size = new System.Drawing.Size(667, 520);
+			this.Load += new System.EventHandler(this.ElementContentGrid_Load);
+			this.panel1.ResumeLayout(false);
+			((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+			((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+			this.contextMenuStrip1.ResumeLayout(false);
+			this.ResumeLayout(false);
 
         }
 

+ 2 - 2
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.resx

@@ -121,7 +121,7 @@
   <data name="pictureBox2.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAKoAAAAfCAYAAAB3cVZEAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        wwAADsMBx2+oZAAABhBJREFUeF7tmI1NZDEMhGmBGmiBHiiBGmiBDuiADqiACmiABuiAHvb0oTU3O2s7
+        wgAADsIBFShKgAAABhBJREFUeF7tmI1NZDEMhGmBGmiBHiiBGmiBDuiADqiACmiABuiAHvb0oTU3O2s7
         eYvQ3ZMykgW8OI5/xk7urg4LCzvAIurCr+Lt7e3w+Ph4uLu7O1xdXZ3I7e3t4eHh4UtnhEXUhV8B5Lu5
         uTkjZyUQ+f39/bj7HEOifnx8pB1xfX399e35+fnw+fl51D4Ha53DdBX2OUeB05n+SJ6eno4W/gIf8BN/
         8Vv1+Zad77i/vz/ZxySoQJFCj/MuBXY4hxzp2eQTf15eXo6ap/AYZ4Q8KDRnrkeOu5qTT90zK/hd1aEk
@@ -153,7 +153,7 @@
   <data name="pictureBox1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAKoAAAAfCAYAAAB3cVZEAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        wgAADsIBFShKgAAABhBJREFUeF7tmI1NZDEMhGmBGmiBHiiBGmiBDuiADqiACmiABuiAHvb0oTU3O2s7
+        wQAADsEBuJFr7QAABhBJREFUeF7tmI1NZDEMhGmBGmiBHiiBGmiBDuiADqiACmiABuiAHvb0oTU3O2s7
         eYvQ3ZMykgW8OI5/xk7urg4LCzvAIurCr+Lt7e3w+Ph4uLu7O1xdXZ3I7e3t4eHh4UtnhEXUhV8B5Lu5
         uTkjZyUQ+f39/bj7HEOifnx8pB1xfX399e35+fnw+fl51D4Ha53DdBX2OUeB05n+SJ6eno4W/gIf8BN/
         8Vv1+Zad77i/vz/ZxySoQJFCj/MuBXY4hxzp2eQTf15eXo6ap/AYZ4Q8KDRnrkeOu5qTT90zK/hd1aEk

+ 206 - 21
OTSIncAReportApp/1-UI/Control_Grids/ParticlesSizeGrid.cs

@@ -1,4 +1,7 @@
 
+using DevExpress.Utils;
+using DevExpress.XtraCharts;
+using OTSIncAReportApp._1_UI.Control_DEVCharts;
 using OTSIncAReportApp.OTSRstMgrFunction;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
@@ -33,12 +36,18 @@ namespace OTSIncAReportGrids
         OTSIncAReportApp.frmReportApp m_ReportApp;
 
         int gridheight = 0;
-        public string condition = "";
-        #endregion
+		int gridwidth = 0;
+		public string condition = "";
+
+        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
 
-        #region 自定义方法
+		#region 自定义方法
 
-        private string getWhere(string max, string min, string col, string partic)
+		private string getWhere(string max, string min, string col, string partic)
         {
 			if (col == "Area")
 			{
@@ -240,14 +249,16 @@ namespace OTSIncAReportGrids
                     gridView.Rows[a1].Cells[k].Value = Convert.ToInt32(gridView.Rows[a1].Cells[k].Value)+ Convert.ToInt32(gridView.Rows[j].Cells[k].Value);
                 }
             }
-            SetDataGridViewStyle(gridView);
+            list_table_Point.Add(SetDataGridViewStyle(gridView));
             panel1.Controls.Add(gridView);
-        }
+			list_table_data.Add(m_dt);
+
+		}
 
         /// <summary>
         /// 设置DataGridView样式
         /// </summary>
-        private void SetDataGridViewStyle(OTSGridView gridView)
+        private Point SetDataGridViewStyle(OTSGridView gridView)
         {
             //用户不能调整标题的高度
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
@@ -289,19 +300,30 @@ namespace OTSIncAReportGrids
             gridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             gridView.ContextMenuStrip = this.contextMenuStrip1;
             gridView.BorderStyle = 0;
-            // gridView.Dock = System.Windows.Forms.DockStyle.Fill;
-            gridView.Location = new System.Drawing.Point(0, gridheight);
+			int outpos = gridwidth;
+
+			gridView.Location = new System.Drawing.Point(gridwidth, 0);
 
-            gridView.Margin = new System.Windows.Forms.Padding(2);
+			gridView.Margin = new System.Windows.Forms.Padding(2);
             gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
 
             gridView.ReadOnly = true;
             gridView.RowHeadersVisible = false;
             gridView.RowHeadersWidth = 40;
             gridView.RowTemplate.Height = 30;
-            gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
-            gridheight = gridheight + gridView.RowCount * 30 + 80;
-            gridView.TabIndex = 0;
+            //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++)
+            {
+                gridView_Width = gridView_Width + gridView.Columns[i].Width;
+
+			}
+			gridView.Size = new System.Drawing.Size(gridView_Width, gridView.RowCount * 30);
+			//gridheight = gridheight + gridView.RowCount * 30 + 80;
+			gridheight = gridheight + gridView.RowCount * 30 + 5;
+            gridwidth = gridwidth + gridView.ColumnCount * 100;
+			gridView.TabIndex = 0;
 
             gridView.SortCompare += Gview_gz_SortCompare;
             gridView.Sorted += Gview_gz_Sorted;
@@ -310,6 +332,10 @@ namespace OTSIncAReportGrids
             gridView.ColumnHeadersHeight = 40;
 
             gridView.Columns[4].Visible = false;
+
+			list_table_size.Add(new Point(gridView.ColumnCount * 100 - 40, gridView.RowCount * 30));
+            return new Point(outpos, gridheight);
+            //list_table_Point.Add(new Point(gridwidth, gridheight));
         }
         #endregion
 
@@ -339,9 +365,13 @@ namespace OTSIncAReportGrids
         }
         private void ParticlesSizeGrid_Load(object sender, EventArgs e)
         {
-            //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
-            //string sou = m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
-            string sou = source.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+			list_table_data.Clear();
+            list_table_size.Clear();
+            list_table_Point.Clear();
+            list_fileName.Clear();
+			//int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+			//string sou = m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
+			string sou = source.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             if (sou.Contains("+"))
             {
                 for (int i = 0; i < sou.Split('+').Length; i++)
@@ -350,7 +380,9 @@ namespace OTSIncAReportGrids
                     if (resultFile != null)
                     {
                         BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName);
-                    }
+                        list_fileName.Add(resultFile.anotherFileName);
+
+					}
                 }
             }
             else
@@ -358,15 +390,168 @@ namespace OTSIncAReportGrids
                 for (int i=0;i< m_ReportApp.m_rstDataMgr.ResultFilesList.Count;i++)
                 {
                     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);
+                    {
+						BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName);
+                        list_fileName.Add(m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName);
+					}
+                 
                 }
                 //BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
             }
+
+
+            for (int i = 0; i < list_table_data.Count; i++)
+            { 
+            
+            }
         }
-        #endregion
 
-        #region 相关事件
-        private void ToolStripMenuItem1_Click(object sender, EventArgs e)
+        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);
+			}
+            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_Stacking(list_table_data[i], stdId, list_table_size[i],list_table_Point[i], high);
+			}
+
+		}
+        /// <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]["pname"].ToString() == stdId)
+					{
+						for (int a = 7; a < dt.Columns.Count-1; a++)
+						{
+							DataRow dr = dataTable.NewRow();
+							dr["name"] = dt.Columns[a].ColumnName;
+							dr["size"] = Convert.ToInt16(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 = 6; a < dt.Columns.Count-1; a++)
+					{
+						DataRow dr = data.NewRow();
+						dr["name"] = dt.Rows[i]["pname"].ToString();
+						dr["range"] = dt.Columns[a].ColumnName;
+						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(), int.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 相关事件
+		private void ToolStripMenuItem1_Click(object sender, EventArgs e)
         {
             //复制整个表
             CopyAll();

+ 6 - 3
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/OTSSampleReportInfo/OTSSampleReportInfo.cs

@@ -174,10 +174,13 @@ namespace OTSIncAReportApp.OTSSampleReportInfo
         /// <summary>
         /// 颗粒列表
         /// </summary>
-        PARTICE_LIST=17
-
+        PARTICE_LIST=17,
+        /// <summary>
+        /// 图形类型
+        /// </summary>
+			GRAPHIC_TYPE=18
 
-    };
+	};
     /// <summary>
     /// 数据源类型
     /// </summary>

+ 30 - 8
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -196,6 +196,7 @@ namespace OTSIncAReportApp
             //计算方式
             AddGridData(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, dimensionCalculationMethod, OTS_ITEM_TYPES.COMBO, false, "image property calculation method", DefaultSIZE_CAL_METHOD_TYPE, m_rstDataMgr.GetSizeCalMethodTypeList(), ind);
             //数据表类型
+            
             List<string> list2 = new List<string>() { granularComponent, particleSizeDistribution, averageElementComposition, ternaryPhaseDiagram };
             ResultFile resultinfo = m_rstDataMgr.ResultFilesList[m_rstDataMgr.GetWorkingResultId()];
             var Systype = RptConfigFile.GetRptConfig().Systype;
@@ -234,7 +235,11 @@ namespace OTSIncAReportApp
             //颗粒列表数据类型
             List<string> list_PARTICE_LIST = new List<string>() { analyticalParticle, otherParticles, MergeParticles, allParticles };
             AddGridData(OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST, dataSourceType, OTS_ITEM_TYPES.COMBO, false, "data source type", list_PARTICE_LIST[0], list_PARTICE_LIST, 0);
-        }
+			//chart图形类型
+			List<string> cahrtType = new List<string>() { "柱状图", "折线图", "饼图", "圆环图", "气泡图", "簇状条形图" , "堆积条形图", "瀑布图",
+"3D柱状图","3D圆环图","3D饼图","3D折线图","3D百分比堆积条形图","3D漏斗图","3DManhattan 条形图","3D堆积条形图","3D阶梯线图"};
+			AddGridData(OTS_REPORT_PROP_GRID_ITEMS.GRAPHIC_TYPE, "图形类型", OTS_ITEM_TYPES.COMBO, false, "graphic type", cahrtType[0], cahrtType, 0);
+		}
         #region 属性Grid相关方法
         public void ShowsTheDefaultPic()
         {
@@ -496,7 +501,11 @@ namespace OTSIncAReportApp
                     var sampleData5 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE];
                     list.Add(sampleData5);
 
-                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+					//all particle types
+					var stditm = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.STD_ID];
+					list.Add(stditm);
+
+					var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
 
                     list.Insert(2, sampleData1);
                 }
@@ -509,13 +518,21 @@ namespace OTSIncAReportApp
                     var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
 
                     list.Insert(2, sampleData1);
-                }
+					var sampleDataA5 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.GRAPHIC_TYPE];
+					list.Add(sampleDataA5);
+				}
+
+                //元素分析表
                 if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.AVE_ELEMENT_COMP)
                 {
                     var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
-
                     list.Insert(2, sampleData1);
-                }
+					var sampleDataA5 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.GRAPHIC_TYPE];
+					list.Add(sampleDataA5);
+					//all particle types
+					var stditm = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.STD_ID];
+					list.Add(stditm);
+				}
                 if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.TRIO_CHART)
                 {
 
@@ -709,21 +726,26 @@ namespace OTSIncAReportApp
                             m_ReportApp.im_CompositionDistributionGrid.Dock = DockStyle.Fill;
                             m_ReportApp.m_TablesWindowandChart.Controls.Add(m_ReportApp.im_CompositionDistributionGrid);
                             m_ReportApp.m_TablesWindowandChart.Activate();
-                            break;
+
+							m_ReportApp.im_CompositionDistributionGrid.SetGraphicType(m_conditionData);
+							break;
                         case CALCULATE_TABLE_TYPE.PARTICALE_SIZE_DISTRIBUTION://颗粒尺寸分布表
                             m_ReportApp.m_TablesWindowandChart.Controls.Clear();
                             m_ReportApp.im_ParticlesSizeGrid = new ParticlesSizeGrid(m_ReportApp);
                             m_ReportApp.im_ParticlesSizeGrid.Dock = DockStyle.Fill;
                             m_ReportApp.m_TablesWindowandChart.Controls.Add(m_ReportApp.im_ParticlesSizeGrid);
                             m_ReportApp.m_TablesWindowandChart.Activate();
-                            break;
+                            m_ReportApp.im_ParticlesSizeGrid.SetGraphicType(m_conditionData);
+
+							break;
                         case CALCULATE_TABLE_TYPE.AVE_ELEMENT_COMP:
                             m_ReportApp.m_TablesWindowandChart.Controls.Clear();
                             m_ReportApp.im_ElementCompositionAvgGrid = new ElementCompositionAvgGrid(m_ReportApp);
                             m_ReportApp.im_ElementCompositionAvgGrid.Dock = DockStyle.Fill;
                             m_ReportApp.m_TablesWindowandChart.Controls.Add(m_ReportApp.im_ElementCompositionAvgGrid);
                             m_ReportApp.m_TablesWindowandChart.Activate();
-                            break;
+							m_ReportApp.im_ElementCompositionAvgGrid.SetGraphicType(m_conditionData);
+							break;
                         case CALCULATE_TABLE_TYPE.TRIO_CHART:
                             m_ReportApp.m_TablesWindowandChart.Controls.Clear();
                             m_ReportApp.im_EChart_Trianglediagram = new Control_ECharts.DEVChart_Trianglediagram(m_ReportApp);