기타 티차트에 제목 표시하기. (Set title in teechart.)
페이지 정보
본문
안녕하세요. 엔지엠소프트웨어입니다. 쉽고 빠르게 차트를 구현해야 한다면~ 스티마의 티차트(TeeChart)를 사용하는게 좋겠죠? 복잡한 기능이 필요 없다면 [ 윈도우 차트 ]를 사용해도 됩니다. 무료니까요^^; 아무튼, 티차트를 처음 사용하시는 분들을 위해 간단한것들은 정리를 해두려고 합니다. [ 티차트를 설치 ]했으면 윈폼에 추가하고 아래와 같이 코드를 작성하세요.
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
tChart1.Header.Text = "NGMsoftware";
}
}
}
실행하면 티차트에 제목이 설정된것을 확인할 수 있습니다.
상단의 제목이 아닌 X, Y 축에 타이틀을 표시하고 싶을수도 있겠죠? 물론, 커스텀하게 특정 위치에 넣을수도 있습니다.
using Steema.TeeChart;
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";
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";
Axis customAxis = new Axis(false, false, tChart1.Chart);
//customAxis.StartPosition = 20;
//customAxis.EndPosition = 20;
customAxis.AxisPen.Color = Color.Green;
customAxis.Title.Font.Color = Color.Green;
customAxis.Title.Font.Bold = true;
customAxis.Title.Text = "Custom axis";
//customAxis.PositionUnits = PositionUnits.Percent;
customAxis.RelativePosition = 30;
tChart1.Axes.Custom.Add(customAxis);
}
}
}
실행해보면 아래와 같이 각각의 위치에 표시되는걸 알 수 있어요~
개발자에게 후원하기
추천, 구독, 홍보 꼭~ 부탁드립니다.
여러분의 후원이 빠른 귀농을 가능하게 해줍니다~ 답답한 도시를 벗어나 귀농하고 싶은 개발자~
감사합니다~
추천0 비추천0
- 이전글TeeChart - 바차트 만들기. (BarChart) 21.04.30
- 다음글복잡한 데이터를 차트로 간편하게 처리할 수 있는 Steema TeeChart 설치하기. (스티마 티차트) 21.04.29
댓글목록
등록된 댓글이 없습니다.