Selaa lähdekoodia

regulate the element displaying position.

gsp 3 vuotta sitten
vanhempi
commit
5ca4da658a
1 muutettua tiedostoa jossa 17 lisäystä ja 13 poistoa
  1. 17 13
      OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_XRayTable.cs

+ 17 - 13
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_XRayTable.cs

@@ -598,9 +598,7 @@ namespace OTSIncAReportGraph.Controls
 
             #region //右上角输出文字设置-------------------------------------------------------------------------------------------------
             m_i_rightdrawlabellocation_x = m_i_draw_end * f_js_width - 260;
-            //国标
-            //g.DrawString("国标:", m_thisfont, m_this_sb, new PointF(m_i_rightdrawlabellocation_x, m_i_rightdrawlabellocation_y));
-            //
+           
             //国际化
             Language lan = new Language();
             Hashtable table = lan.GetNameTable("Control_XRayTable");
@@ -638,24 +636,30 @@ namespace OTSIncAReportGraph.Controls
 
 
 
-                PointF ls_pt = new PointF(m_i_rightdrawlabellocation_x - (m_list_showelementinfo.Count * 25 - 60), m_i_rightdrawlabellocation_y + 60);
+               
+                StringBuilder sb = new StringBuilder();
                 for (int i = 0; i < m_list_showelementinfo.Count; i++)
                 {
-                    StringBuilder sb = new StringBuilder();
+                   
 
                     sb.Append(m_list_showelementinfo[i].ElementName);
                     sb.Append("(");
                     sb.Append(m_list_showelementinfo[i].Percentage.ToString("0.00/"));
-                    sb.Append(m_list_showelementinfo[i].percentageIn100.ToString("0.00)"));
-                    string str_element = sb.ToString();
-                    //string str_element = m_list_showelementinfo[i].ElementName + "(" + m_list_showelementinfo[i].Percentage.ToString("0.00:") + m_list_showelementinfo[i].percentageIn100.ToString("0.00") +")";
-                    SizeF out_testsizef = g.MeasureString(str_element, m_thisfont);
-                    g.DrawString(str_element, m_thisfont, new SolidBrush(DrawFunction.GetColorByNumber(i + 1)), ls_pt);
-                    ls_pt.X = ls_pt.X + out_testsizef.Width -4;
+                    sb.Append(m_list_showelementinfo[i].percentageIn100.ToString("0.00) "));
+                    
                 }
+                string str_element = sb.ToString();
+                SizeF out_testsizef = g.MeasureString(str_element, m_thisfont);
+
+          
+                PointF ls_pt = new PointF(m_i_rightdrawlabellocation_x , m_i_rightdrawlabellocation_y + 60);
+
+                ls_pt.X = (ls_pt.X - out_testsizef.Width/2) ;
+                
+                g.DrawString(str_element, m_thisfont, new SolidBrush(DrawFunction.GetColorByNumber( 1)), ls_pt);
+               
             }
-            //标准库显示
-            //g.DrawString("标准来自: "+m_stdname, m_thisfont, m_this_sb_blue, new PointF(m_i_rightdrawlabellocation_x + 10, m_i_rightdrawlabellocation_y + 80));
+          
             #endregion //------------------------------------------------------------------------------------------------------------------
 
         }