기타 TeeChart - 라인차트 만들기. (LineChart)
페이지 정보
본문
안녕하세요. 엔지엠소프트웨어입니다. 라인차트 만드는 방법입니다.
using Steema.TeeChart;
using Steema.TeeChart.Styles;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
tChart1.Header.Text = "NGMsoftware";
Axis leftAxis = tChart1.Axes.Left;
leftAxis.AxisPen.Color = Color.Red;
leftAxis.Title.Font.Color = Color.Red;
leftAxis.Title.Font.Bold = true;
leftAxis.Title.Text = "Alarm count";
leftAxis.SetMinMax(0, 100);
Axis bottomAxis = tChart1.Axes.Bottom;
bottomAxis.AxisPen.Color = Color.Red;
bottomAxis.Title.Font.Color = Color.Red;
bottomAxis.Title.Font.Bold = true;
bottomAxis.Title.Text = "Date time";
bottomAxis.Labels.Angle = 45;
Line line = new Line(tChart1.Chart);
line.Add(DateTime.Parse("2021-01-01"), 70);
line.Add(DateTime.Parse("2021-02-01"), 100);
line.Add(DateTime.Parse("2021-03-01"), 90);
line.Add(DateTime.Parse("2021-04-01"), 40);
line.Add(DateTime.Parse("2021-05-01"), 90);
}
}
}
실행하면 아래와 같이 표시됩니다.
참고로 X축에서 0이 표시되지 않으면 아래 한줄을 추가하세요~
leftAxis.SetMinMax(0, 100);
개발자에게 후원하기
추천, 구독, 홍보 꼭~ 부탁드립니다.
여러분의 후원이 빠른 귀농을 가능하게 해줍니다~ 답답한 도시를 벗어나 귀농하고 싶은 개발자~
감사합니다~
추천0 비추천0
- 이전글1부 - 개발자라면 알아야 하는 기본 원칙. (Basic principles that developers should know.) 21.05.01
- 다음글TeeChart - 바차트 만들기. (BarChart) 21.04.30
댓글목록
등록된 댓글이 없습니다.