From 7bdde150c20e3fe4273b9f71ff511e0855d8f038 Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 24 Sep 2024 22:22:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A4=BA=E4=BE=8B=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI.Demo/Charts/FLineChart.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SunnyUI.Demo/Charts/FLineChart.cs b/SunnyUI.Demo/Charts/FLineChart.cs index 6b788251..5c6c3c65 100644 --- a/SunnyUI.Demo/Charts/FLineChart.cs +++ b/SunnyUI.Demo/Charts/FLineChart.cs @@ -18,6 +18,13 @@ namespace Sunny.UI.Demo DateTime dt = new DateTime(2020, 10, 4); UILineOption option = new UILineOption(); + + //设置图表边框空白部分尺寸 + option.Grid.Left = 60; + option.Grid.Right = 60; + option.Grid.Top = 60; + option.Grid.Bottom = 60; + option.ToolTip.Visible = true; option.Title = new UITitle(); option.Title.Text = "SunnyUI"; @@ -40,6 +47,7 @@ namespace Sunny.UI.Demo //数据点显示小数位数 series.YAxisDecimalPlaces = 2; + //增加曲线时,可以设置曲线颜色,例如Color.Lime series = option.AddSeries(new UILineSeries("Line2", Color.Lime)); series.Add(dt.AddHours(3), 3.3); series.Add(dt.AddHours(4), 2.3); @@ -116,6 +124,9 @@ namespace Sunny.UI.Demo //设置曲线显示最大点数,超过后自动清理 series.SetMaxCount(50); + //设置曲线平滑 + series.Smooth = true; + //坐标轴显示小数位数 option.XAxis.AxisLabel.DecimalPlaces = 1; option.YAxis.AxisLabel.DecimalPlaces = 1;