diff --git a/ISCamRecorder/MainForm.Designer.cs b/ISCamRecorder/MainForm.Designer.cs index 9236a89..ee80fc8 100644 --- a/ISCamRecorder/MainForm.Designer.cs +++ b/ISCamRecorder/MainForm.Designer.cs @@ -201,7 +201,13 @@ this.chart1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - chartArea1.AxisX.LabelStyle.Format = "hh:mm:ss"; + chartArea1.AxisX.IsLabelAutoFit = false; + chartArea1.AxisX.LabelStyle.Angle = 90; + chartArea1.AxisX.LabelStyle.Format = "HH:mm:ss"; + chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.Gray; + chartArea1.AxisY.LabelStyle.Enabled = false; + chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.Gray; + chartArea1.AxisY.Maximum = 1050D; chartArea1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); chartArea1.Name = "ChartArea1"; chartArea1.Position.Auto = false; diff --git a/ISCamRecorder/MainForm.cs b/ISCamRecorder/MainForm.cs index 0798db6..dbe020d 100644 --- a/ISCamRecorder/MainForm.cs +++ b/ISCamRecorder/MainForm.cs @@ -18,6 +18,7 @@ public partial class MainForm : Form { readonly int PLOT_LENGTH = 200; + readonly int PLOT_YAXIS_MIN = 800; private System.Threading.Timer _UITimer; // UI更新タイマー List _Cameras = new List (); // カメラオブジェクト @@ -88,9 +89,13 @@ /// グラフをプロット /// private void Plot() { + if (_Sensor.Values.Count < 1) return; chart1.Series[0].Points.Clear(); lock (SensorData.Locker) { chart1.Series[0].Points.DataBindXY(_Sensor.Times, _Sensor.Values); + var minValue = _Sensor.Values.Min(); + chart1.ChartAreas[0].AxisY.Minimum = + minValue < PLOT_YAXIS_MIN ? minValue : PLOT_YAXIS_MIN; } }