728x90
반응형
728x170
▶ MainForm.cs
using System.Drawing;
using System.Windows.Forms;
using ScottPlot;
using ScottPlot.Renderable;
namespace TestProject
{
/// <summary>
/// 메인 폼
/// </summary>
public partial class MainForm : Form
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainForm()
/// <summary>
/// 생성자
/// </summary>
public MainForm()
{
InitializeComponent();
Plot plot = new Plot(800, 600);
plot.AddSignal(DataGen.Sin(51), label : "sin");
plot.AddSignal(DataGen.Cos(51), label : "cos");
plot.AddText
(
"very graph",
25,
0.8,
new ScottPlot.Drawing.Font()
{
Name = "comic sans ms",
Size = 24,
Color = Color.Blue,
Bold = true
}
);
plot.AddText
(
"so data",
0,
0,
new ScottPlot.Drawing.Font()
{
Name = "comic sans ms",
Size = 42,
Color = Color.Magenta,
Bold = true
}
);
plot.AddText
(
"many documentation",
3,
-0.6,
new ScottPlot.Drawing.Font()
{
Name = "comic sans ms",
Size = 18,
Color = Color.DarkBlue,
Bold = true
}
);
plot.AddText
(
"wow.",
10,
0.6,
new ScottPlot.Drawing.Font()
{
Name = "comic sans ms",
Size = 36,
Color = Color.Green,
Bold = true
}
);
plot.AddText
(
"NuGet",
32,
0,
new ScottPlot.Drawing.Font()
{
Name = "comic sans ms",
Size = 24,
Color = Color.Gold,
Bold = true
}
);
plot.YAxis.Label
(
label : "vertical units",
fontName : "impact",
size : 24,
color : Color.Red,
bold : true
);
plot.XAxis.Label
(
label : "horizontal units",
fontName : "georgia",
size : 24,
color : Color.Blue,
bold : true
);
plot.XAxis2.Label
(
label : "Impressive Graph",
size : 24,
color : Color.Purple,
bold : true
);
plot.XAxis.TickLabelStyle(color : Color.DarkBlue , fontName : "comic sans ms", fontSize : 16);
plot.YAxis.TickLabelStyle(color : Color.DarkGreen, fontName : "comic sans ms", fontSize : 16);
Legend legend = plot.Legend();
legend.FontName = "comic sans ms";
legend.FontSize = 18;
legend.FontColor = Color.DarkBlue;
legend.FontBold = true;
this.formsPlot.Reset(plot);
this.formsPlot.Refresh();
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
댓글을 달아 주세요