NGMsoftware

NGMsoftware
로그인 회원가입
  • 매뉴얼
  • 학습
  • 매뉴얼

    학습


    기타 티차트에 제목 표시하기. (Set title in teechart.)

    페이지 정보

    본문

    안녕하세요. 엔지엠소프트웨어입니다. 쉽고 빠르게 차트를 구현해야 한다면~ 스티마의 티차트(TeeChart)를 사용하는게 좋겠죠? 복잡한 기능이 필요 없다면 [ 윈도우 차트 ]를 사용해도 됩니다. 무료니까요^^; 아무튼, 티차트를 처음 사용하시는 분들을 위해 간단한것들은 정리를 해두려고 합니다. [ 티차트를 설치 ]했으면 윈폼에 추가하고 아래와 같이 코드를 작성하세요.

    using System.Windows.Forms;
    
    namespace WindowsFormsApp1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
    
                tChart1.Header.Text = "NGMsoftware";
            }
        }
    }

     

     

    실행하면 티차트에 제목이 설정된것을 확인할 수 있습니다.

    bCyGf7c.png

     

     

    상단의 제목이 아닌 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);
            }
        }
    }

     

     

    실행해보면 아래와 같이 각각의 위치에 표시되는걸 알 수 있어요~

    H50q85q.png

     

     

    개발자에게 후원하기

    MGtdv7r.png

     

    추천, 구독, 홍보 꼭~ 부탁드립니다.

    여러분의 후원이 빠른 귀농을 가능하게 해줍니다~ 답답한 도시를 벗어나 귀농하고 싶은 개발자~

    감사합니다~

    • 네이버 공유하기
    • 페이스북 공유하기
    • 트위터 공유하기
    • 카카오스토리 공유하기
    추천0 비추천0

    댓글목록

    등록된 댓글이 없습니다.