diff --git a/Bin/SunnyUI.Demo.exe b/Bin/SunnyUI.Demo.exe index e6aa8368..670fe728 100644 Binary files a/Bin/SunnyUI.Demo.exe and b/Bin/SunnyUI.Demo.exe differ diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 160f77cc..b4a77019 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Charts/FLineChart.cs b/SunnyUI.Demo/Charts/FLineChart.cs index d84c4ad6..c720e6aa 100644 --- a/SunnyUI.Demo/Charts/FLineChart.cs +++ b/SunnyUI.Demo/Charts/FLineChart.cs @@ -57,6 +57,9 @@ namespace Sunny.UI.Demo.Charts option.YAxis.Name = "数值"; option.XAxis.AxisLabel.DateTimeFormat = DateTimeEx.DateTimeFormat; + option.XAxisScaleLines.Add(new UIScaleLine() { Color = Color.Red, Name = dt.AddHours(3).DateTimeString(), Value = new DateTimeInt64(dt.AddHours(3)) }); + option.XAxisScaleLines.Add(new UIScaleLine() { Color = Color.Red, Name = dt.AddHours(6).DateTimeString(), Value = new DateTimeInt64(dt.AddHours(6)) }); + LineChart.SetOption(option); } diff --git a/SunnyUI.Demo/FMain.Designer.cs b/SunnyUI.Demo/FMain.Designer.cs index 48ba6da1..def0c202 100644 --- a/SunnyUI.Demo/FMain.Designer.cs +++ b/SunnyUI.Demo/FMain.Designer.cs @@ -105,7 +105,6 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1024, 720); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximumSize = new System.Drawing.Size(1366, 728); this.MinimumSize = new System.Drawing.Size(1024, 720); this.Name = "FMain"; this.Padding = new System.Windows.Forms.Padding(2, 35, 2, 2); @@ -113,6 +112,7 @@ this.ShowRadius = false; this.ShowShadow = true; this.Text = "SunnyUI.Net"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Selecting += new Sunny.UI.UIMainFrame.OnSelecting(this.FMain_Selecting); this.Header.ResumeLayout(false); this.ResumeLayout(false); diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index 9e789446..2c7393b0 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -444,6 +444,29 @@ namespace Sunny.UI if (line.Left == UILeftAlignment.Right) g.DrawString(line.Name, SubFont, line.Color, Width - sf.Width - 4 - Option.Grid.Right, pos - 2 - sf.Height); } + + int idx = 0; + foreach (var line in Option.XAxisScaleLines) + { + float pos = XScale.CalcXPixel(line.Value, DrawOrigin.X, DrawSize.Width); + using (Pen pn = new Pen(line.Color, line.Size)) + { + g.DrawLine(pn, pos, DrawOrigin.Y, pos, Option.Grid.Top); + } + + SizeF sf = g.MeasureString(line.Name, SubFont); + float x = pos - sf.Width - 4; + if (x < Option.Grid.Left) x = pos + 4; + float y = Option.Grid.Top + 4 + sf.Height * idx; + if (y > Height - Option.Grid.Bottom) + { + idx = 0; + y = Option.Grid.Top + 4 + sf.Height * idx; + } + + idx++; + g.DrawString(line.Name, SubFont, line.Color, x, y); + } } private readonly List selectPoints = new List(); diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 68654edc..da95abf2 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -239,7 +239,7 @@ namespace Sunny.UI /// /// 是否以全屏模式进入最大化 /// - [Description("是否以全屏模式进入最大化"), Category("WindowStyle"), DefaultValue(false)] + [Description("是否以全屏模式进入最大化"), Category("WindowStyle")] public bool ShowFullScreen { get => showFullScreen; diff --git a/SunnyUI/Static/UDir.cs b/SunnyUI/Static/UDir.cs index f8bee919..184a90e9 100644 --- a/SunnyUI/Static/UDir.cs +++ b/SunnyUI/Static/UDir.cs @@ -38,7 +38,8 @@ namespace Sunny.UI /// 结果 public static string CurrentDir() { - return Environment.CurrentDirectory.DealPath(); + //return Environment.CurrentDirectory.DealPath(); + return AppDomain.CurrentDomain.BaseDirectory.DealPath(); } ///