Browse Source

修改Chartbug数量显示

zhangjiaxin 7 months ago
parent
commit
4ed7bd7838
1 changed files with 14 additions and 8 deletions
  1. 14 8
      OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

+ 14 - 8
OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

@@ -86,21 +86,27 @@ namespace OTSIncAReportApp.Control_ECharts
                 string str = resultFile.anotherFileName;
                 prListString.Add(str);
                 // 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
-                Series series = new Series(str, ViewType.Bar);
-                for (int a = 0; a < list_dt[i].Rows.Count; a++)
+                //string str = prListString[i];
+                Series series = new Series(str, ViewType.Pie);
+                for (int a = 0; a < prListData[i].Rows.Count; a++)
                 {
-                    string name = list_dt[i].Rows[a]["name"].ToString();
-                    string Cunt = list_dt[i].Rows[a]["Cunt"].ToString();
+                    string name = prListData[i].Rows[a]["name"].ToString();
+                    double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
                     series.Points.Add(new SeriesPoint(name, Cunt));
                 }
                 series.LabelsVisibility = DefaultBoolean.True;
-                series.Label.TextPattern = "{V}";
+                series.Label.TextPattern = "{A}";
                 chartControl1.Series.Add(series);
             }
             chartControl1.Legend.Visibility = DefaultBoolean.False;
             chartControl1.Refresh();
             panel1.Dock = DockStyle.Fill;
             chartControl1.Dock = DockStyle.Fill;
+
+            checkButton1.Checked = false;
+            checkButton2.Checked = false;
+            checkButton3.Checked = true;
+           
         }
 
         #endregion
@@ -466,7 +472,7 @@ namespace OTSIncAReportApp.Control_ECharts
                     for (int a = 0; a < prListData[i].Rows.Count; a++)
                     {
                         string name = prListData[i].Rows[a]["name"].ToString();
-                        string Cunt = prListData[i].Rows[a]["Cunt"].ToString();
+                        double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
                         series.Points.Add(new SeriesPoint(name, Cunt));
                     }
                     series.LabelsVisibility = DefaultBoolean.True;
@@ -504,7 +510,7 @@ namespace OTSIncAReportApp.Control_ECharts
                     for (int a = 0; a < prListData[i].Rows.Count; a++)
                     {
                         string name = prListData[i].Rows[a]["name"].ToString();
-                        string Cunt = prListData[i].Rows[a]["Cunt"].ToString();
+                        double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
                         series.Points.Add(new SeriesPoint(name, Cunt));
                     }
                     series.LabelsVisibility = DefaultBoolean.True;
@@ -537,7 +543,7 @@ namespace OTSIncAReportApp.Control_ECharts
                     for (int a = 0; a < prListData[i].Rows.Count; a++)
                     {
                         string name = prListData[i].Rows[a]["name"].ToString();
-                        int Cunt = Convert.ToInt16(prListData[i].Rows[a]["Cunt"]);
+                        double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
                         series.Points.Add(new SeriesPoint(name, Cunt));
                     }
                     series.LabelsVisibility = DefaultBoolean.True;