|
@@ -1,5 +1,6 @@
|
|
|
using NPOI.SS.UserModel;
|
|
|
using NPOI.XSSF.UserModel;
|
|
|
+using OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration;
|
|
|
using OTSIncAReportApp.DataOperation.DataAccess;
|
|
|
using OTSIncAReportApp.OTSRstMgrFunction;
|
|
|
using OTSIncAReportApp.OTSSampleReportInfo;
|
|
@@ -98,79 +99,88 @@ namespace OTSIncAReportApp.Control_ECharts
|
|
|
List<Color> Color_list = SetColor_list();
|
|
|
string str_unit = "";
|
|
|
int PositionJeight = 27;
|
|
|
- for (int i = 0; i < listName.Count; i = i + 10)
|
|
|
+ TernaryDiagram ternaryDiagram = new TernaryDiagram();
|
|
|
+ for (int i = 0; i < listName.Count; i = i + 8)
|
|
|
{
|
|
|
if (i < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i]);
|
|
|
- g.DrawRectangle(mypen, 0, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 1, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i].ToString() + str_unit, myFont2, sbrush, 12, PositionJeight - 2);
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i]);
|
|
|
+ ternaryDiagram.ShapeList(1, new PointF(10, PositionJeight), 10, Color_list[i], g);
|
|
|
+ //g.DrawRectangle(mypen, 0, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 1, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i].ToString() + str_unit, myFont2, sbrush, 22, PositionJeight - 2);
|
|
|
}
|
|
|
if (i + 1 < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 1]);
|
|
|
- g.DrawRectangle(mypen, 94, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 95, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 1].ToString() + str_unit, myFont2, sbrush, 106, PositionJeight - 2);
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 1]);
|
|
|
+ ternaryDiagram.ShapeList(2, new PointF(104, PositionJeight), 10, Color_list[i+1], g);
|
|
|
+ //g.DrawRectangle(mypen, 94, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 95, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 1].ToString() + str_unit, myFont2, sbrush, 116, PositionJeight - 2);
|
|
|
}
|
|
|
if (i + 2 < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 2]);
|
|
|
- g.DrawRectangle(mypen, 188, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 189, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 2].ToString() + str_unit, myFont2, sbrush, 199, PositionJeight - 2);
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 2]);
|
|
|
+ ternaryDiagram.ShapeList(3, new PointF(194, PositionJeight), 10, Color_list[i + 2], g);
|
|
|
+ //g.DrawRectangle(mypen, 188, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 189, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 2].ToString() + str_unit, myFont2, sbrush, 206, PositionJeight - 2);
|
|
|
}
|
|
|
|
|
|
if (i + 3 < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 3]);
|
|
|
- g.DrawRectangle(mypen, 282, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 283, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 3].ToString() + str_unit, myFont2, sbrush, 292, PositionJeight - 2);
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 3]);
|
|
|
+ ternaryDiagram.ShapeList(4, new PointF(292, PositionJeight), 10, Color_list[i + 3], g);
|
|
|
+ //g.DrawRectangle(mypen, 282, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 283, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 3].ToString() + str_unit, myFont2, sbrush, 304, PositionJeight - 2);
|
|
|
}
|
|
|
if (i + 4 < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 4]);
|
|
|
- g.DrawRectangle(mypen, 376, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 377, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 4].ToString() + str_unit, myFont2, sbrush, 386, PositionJeight - 2);
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 4]);
|
|
|
+ ternaryDiagram.ShapeList(1, new PointF(386, PositionJeight), 10, Color_list[i + 4], g);
|
|
|
+ //g.DrawRectangle(mypen, 376, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 377, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 4].ToString() + str_unit, myFont2, sbrush, 398, PositionJeight - 2);
|
|
|
}
|
|
|
if (i + 5 < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
- g.DrawRectangle(mypen, 470, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 471, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 5].ToString() + str_unit, myFont2, sbrush, 480, PositionJeight - 2);
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
+ ternaryDiagram.ShapeList(2, new PointF(480, PositionJeight), 10, Color_list[i + 5], g);
|
|
|
+ //g.DrawRectangle(mypen, 470, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 471, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 5].ToString() + str_unit, myFont2, sbrush, 492, PositionJeight - 2);
|
|
|
}
|
|
|
if (i + 6 < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
- g.DrawRectangle(mypen, 564, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 565, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 6].ToString() + str_unit, myFont2, sbrush, 574, PositionJeight - 2);
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 6]);
|
|
|
+ ternaryDiagram.ShapeList(3, new PointF(574, PositionJeight), 10, Color_list[i + 6], g);
|
|
|
+ //g.DrawRectangle(mypen, 564, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 565, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 6].ToString() + str_unit, myFont2, sbrush, 586, PositionJeight - 2);
|
|
|
}
|
|
|
if (i + 7 < listName.Count)
|
|
|
{
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
- g.DrawRectangle(mypen, 658, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 659, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 7].ToString() + str_unit, myFont2, sbrush, 668, PositionJeight - 2);
|
|
|
- }
|
|
|
- if (i + 8 < listName.Count)
|
|
|
- {
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
- g.DrawRectangle(mypen, 752, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 753, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 8].ToString() + str_unit, myFont2, sbrush, 762, PositionJeight - 2);
|
|
|
- }
|
|
|
- if (i + 9 < listName.Count)
|
|
|
- {
|
|
|
- SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
- g.DrawRectangle(mypen, 846, PositionJeight, 8, 8);
|
|
|
- g.FillRectangle(sbrush_Color, 847, PositionJeight + 1, 7, 7);
|
|
|
- g.DrawString(listName[i + 9].ToString() + str_unit, myFont2, sbrush, 856, PositionJeight - 2);
|
|
|
- }
|
|
|
+ //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 7]);
|
|
|
+ ternaryDiagram.ShapeList(4, new PointF(668, PositionJeight), 10, Color_list[i + 7], g);
|
|
|
+ //g.DrawRectangle(mypen, 658, PositionJeight, 8, 8);
|
|
|
+ //g.FillRectangle(sbrush_Color, 659, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 7].ToString() + str_unit, myFont2, sbrush, 680, PositionJeight - 2);
|
|
|
+ }
|
|
|
+ //if (i + 8 < listName.Count)
|
|
|
+ //{
|
|
|
+ // SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
+ // g.DrawRectangle(mypen, 752, PositionJeight, 8, 8);
|
|
|
+ // g.FillRectangle(sbrush_Color, 753, PositionJeight + 1, 7, 7);
|
|
|
+ // g.DrawString(listName[i + 8].ToString() + str_unit, myFont2, sbrush, 762, PositionJeight - 2);
|
|
|
+ //}
|
|
|
+ //if (i + 9 < listName.Count)
|
|
|
+ //{
|
|
|
+ // SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
|
|
|
+ // g.DrawRectangle(mypen, 846, PositionJeight, 8, 8);
|
|
|
+ // g.FillRectangle(sbrush_Color, 847, PositionJeight + 1, 7, 7);
|
|
|
+ // g.DrawString(listName[i + 9].ToString() + str_unit, myFont2, sbrush, 856, PositionJeight - 2);
|
|
|
+ //}
|
|
|
PositionJeight = PositionJeight + 15;
|
|
|
}
|
|
|
PictureBox pictureBox = new PictureBox();
|
|
@@ -358,12 +368,27 @@ namespace OTSIncAReportApp.Control_ECharts
|
|
|
g.DrawString((i * 10).ToString(), new Font("Arial Unicode MS", 8, FontStyle.Bold), new SolidBrush(Color.Black), new Point(y1_b, Line + 8));
|
|
|
g.DrawString(((10 - i) * 10).ToString(), new Font("Arial Unicode MS", 8, FontStyle.Bold), new SolidBrush(Color.Black), new Point(x1_b + 20, x2_b - 5));
|
|
|
}
|
|
|
+ mypen = new Pen(Color.Black, 1);
|
|
|
+ TernaryDiagram ternaryDiagram = new TernaryDiagram();
|
|
|
+ int order = 1;
|
|
|
+ HashSet<int> hashSet = new HashSet<int>();
|
|
|
+
|
|
|
for (int i = 0; i < dt_point_sort.Rows.Count; i++)
|
|
|
{
|
|
|
- mypen = new Pen(Color.Black, 1);
|
|
|
- SolidBrush mysbrush = new SolidBrush(Color_list[Convert.ToInt32(dt_point_sort.Rows[i]["Color_position"])]);
|
|
|
- g.FillRectangle(mysbrush, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 8, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 4, 5);
|
|
|
- g.DrawRectangle(mypen, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 7, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 5, 5);
|
|
|
+ int pos = Convert.ToInt32(dt_point_sort.Rows[i]["Color_position"]);
|
|
|
+ if (pos > 4)
|
|
|
+ {
|
|
|
+ order = pos % 4;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ order = pos;
|
|
|
+ }
|
|
|
+ PointF pointF = new PointF(Convert.ToInt32(dt_point_sort.Rows[i]["X"])+10, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]));
|
|
|
+ ternaryDiagram.ShapeList(order, pointF, 10, Color_list[pos-1], g);
|
|
|
+ //SolidBrush mysbrush = new SolidBrush(Color_list[Convert.ToInt32(dt_point_sort.Rows[i]["Color_position"])]);
|
|
|
+ //g.FillRectangle(mysbrush, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 8, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 4, 5);
|
|
|
+ //g.DrawRectangle(mypen, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 7, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 5, 5);
|
|
|
}
|
|
|
Font myFont = new Font("Arial Unicode MS", 13, FontStyle.Bold);
|
|
|
Font Font_features = new Font("Arial Unicode MS", 10, FontStyle.Bold);
|