|
@@ -6,6 +6,7 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Drawing;
|
|
|
using System.Linq;
|
|
|
+using System.Text;
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
namespace OTSIncAReportGraph.Controls
|
|
@@ -619,15 +620,38 @@ namespace OTSIncAReportGraph.Controls
|
|
|
g.DrawString(m_goodname, m_thisfont_bold, m_this_sb, new PointF(m_i_rightdrawlabellocation_x + 50, m_i_rightdrawlabellocation_y + 40));
|
|
|
|
|
|
//show element list information,using the elementlist number to make sure width,number take width 25 growth
|
|
|
+
|
|
|
if (m_list_showelementinfo != null)
|
|
|
{
|
|
|
+ //make it 100%
|
|
|
+ double sumpercentage = 0;
|
|
|
+ for (int i = 0; i < m_list_showelementinfo.Count; i++)
|
|
|
+ {
|
|
|
+ sumpercentage += m_list_showelementinfo[i].Percentage;
|
|
|
+
|
|
|
+ }
|
|
|
+ for (int i = 0; i < m_list_showelementinfo.Count; i++)
|
|
|
+ {
|
|
|
+ m_list_showelementinfo[i].percentageIn100 = m_list_showelementinfo[i].Percentage / sumpercentage * 100;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
PointF ls_pt = new PointF(m_i_rightdrawlabellocation_x - (m_list_showelementinfo.Count * 25 - 60), m_i_rightdrawlabellocation_y + 60);
|
|
|
for (int i = 0; i < m_list_showelementinfo.Count; i++)
|
|
|
{
|
|
|
- string str_element = "" + m_list_showelementinfo[i].ElementName + "(" + m_list_showelementinfo[i].Percentage.ToString("0.00") + ")";
|
|
|
+ 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 + 2;
|
|
|
+ ls_pt.X = ls_pt.X + out_testsizef.Width -4;
|
|
|
}
|
|
|
}
|
|
|
//标准库显示
|
|
@@ -698,6 +722,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
public string ElementName;
|
|
|
public double Percentage;//实际能谱返回的质量百分比
|
|
|
public double dKF;//K峰,元素周期表中固定值
|
|
|
+ public double percentageIn100;//归一化后的百分比
|
|
|
}
|
|
|
#endregion
|
|
|
|