Commit cf55a664 authored by 潘栩锋's avatar 潘栩锋 🚴

改进 X轴小数点保留2位

parent fea0a991
...@@ -56,6 +56,9 @@ namespace FLY.Thick.Base.UI ...@@ -56,6 +56,9 @@ namespace FLY.Thick.Base.UI
chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
//chartArea1.AxisX.LabelStyle.Format = "%F2";
chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold); chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
...@@ -272,6 +275,7 @@ namespace FLY.Thick.Base.UI ...@@ -272,6 +275,7 @@ namespace FLY.Thick.Base.UI
} }
thick = CurveCore.AD2Value(ad, AD2ValueFlag.NoRevised); thick = CurveCore.AD2Value(ad, AD2ValueFlag.NoRevised);
thick = Math.Round(thick, 2);
chart1.Series["Series 1"].Points.AddXY(thick, ad); chart1.Series["Series 1"].Points.AddXY(thick, ad);
chart1.Series["Series 1"].Points[chart1.Series["Series 1"].Points.Count() - 1].MarkerStyle = chart1.Series["Series 1"].Points[chart1.Series["Series 1"].Points.Count() - 1].MarkerStyle =
System.Windows.Forms.DataVisualization.Charting.MarkerStyle.None; System.Windows.Forms.DataVisualization.Charting.MarkerStyle.None;
...@@ -375,8 +379,13 @@ namespace FLY.Thick.Base.UI ...@@ -375,8 +379,13 @@ namespace FLY.Thick.Base.UI
FromSheet(sheet, dataTable_info); FromSheet(sheet, dataTable_info);
} }
page.Dispatcher.Invoke(() =>
{
Curves.CollectionChanged -= Curves_CollectionChanged; Curves.CollectionChanged -= Curves_CollectionChanged;
this.PropertyChanged -= PgCurveVm_PropertyChanged; this.PropertyChanged -= PgCurveVm_PropertyChanged;
Curves.Clear(); Curves.Clear();
for (int i = 0; i < dataTable_curve.Rows.Count; i++) for (int i = 0; i < dataTable_curve.Rows.Count; i++)
{ {
...@@ -388,12 +397,16 @@ namespace FLY.Thick.Base.UI ...@@ -388,12 +397,16 @@ namespace FLY.Thick.Base.UI
if (dataTable_info.Rows.Count > 0) if (dataTable_info.Rows.Count > 0)
{ {
var dataRow = dataTable_curve.Rows[0]; var dataRow = dataTable_info.Rows[0];
Flag = (CurveType)Enum.Parse(typeof(CurveType), (string)dataRow["曲线类型"]); Flag = (CurveType)Enum.Parse(typeof(CurveType), (string)dataRow["曲线类型"]);
CorrectWay = (CurveCorrectWay)Enum.Parse(typeof(CurveCorrectWay), (string)dataRow["校正方式"]); CorrectWay = (CurveCorrectWay)Enum.Parse(typeof(CurveCorrectWay), (string)dataRow["校正方式"]);
} }
this.PropertyChanged += PgCurveVm_PropertyChanged; this.PropertyChanged += PgCurveVm_PropertyChanged;
Curves.CollectionChanged += Curves_CollectionChanged; Curves.CollectionChanged += Curves_CollectionChanged;
});
} }
void FromSheet(ExcelWorksheet sheet, DataTable dataTable) void FromSheet(ExcelWorksheet sheet, DataTable dataTable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment