[SCOTTPLOT/WINFORM] BarPlot 클래스 : Orientation 속성을 사용해 수평 막대 그래프 차트 그리기
ScottPlot/WinForm 2022. 2. 2. 01:07728x90
728x170
▶ MainForm.cs
using System.Windows.Forms;
using ScottPlot;
using ScottPlot.Plottable;
namespace TestProject
{
/// <summary>
/// 메인 폼
/// </summary>
public partial class MainForm : Form
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainForm()
/// <summary>
/// 생성자
/// </summary>
public MainForm()
{
InitializeComponent();
Plot plot = new Plot(800, 600);
double[] valueArray = { 26, 20, 23, 7, 16 };
double[] errorArray = { 3 , 2 , 5 , 1, 3 };
double[] positionArray = { 1 , 2 , 3 , 4, 5 };
BarPlot barPlot = plot.AddBar(valueArray, errorArray, positionArray);
barPlot.Orientation = ScottPlot.Orientation.Horizontal;
plot.SetAxisLimits(xMin : 0);
this.formsPlot.Reset(plot);
this.formsPlot.Refresh();
}
#endregion
}
}
728x90
그리드형(광고전용)