NGMsoftware

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

    학습


    기타 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);
            }
        }
    }

     

     

    실행하면 아래와 같이 표시됩니다.

    ygzfIzG.png

     

     

    참고로 X축에서 0이 표시되지 않으면 아래 한줄을 추가하세요~

    leftAxis.SetMinMax(0, 100);

     

     

    개발자에게 후원하기

    MGtdv7r.png

     

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

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

    감사합니다~

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

    댓글목록

    등록된 댓글이 없습니다.