첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
------------------------------------------------------------------------------------------------------------------------------------------------------
728x90
728x170

TestProject.zip
0.01MB

▶ MainForm.cs

using System;
using System.Drawing;
using System.Windows.Forms;

using Steema.TeeChart.Drawing;
using Steema.TeeChart.Editors;
using Steema.TeeChart.Styles;

namespace TestProject
{
    /// <summary>
    /// 메인 폼
    /// </summary>
    public partial class MainForm : Form
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Field
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region Field

        /// <summary>
        /// 바
        /// </summary>
        private Bar bar;

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainForm()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            Text = "Bar 클래스 : Brush 속성을 사용해 그라디언트 색상 설정하기";

            this.tChart.Panel.Pen = new ChartPen(Color.Black);

            this.bar = new Bar();

            this.bar.Brush.Color                = Color.Red;
            this.bar.Brush.Solid                = true;
            this.bar.Brush.Gradient.EndColor    = Color.FromArgb(254, 138, 138, 0  );
            this.bar.Brush.Gradient.MiddleColor = Color.FromArgb(254, 236, 236, 0  );
            this.bar.Brush.Gradient.StartColor  = Color.FromArgb(254, 255, 255, 192);
            this.bar.Brush.Gradient.UseMiddle   = true;
            this.bar.Brush.Gradient.Visible     = true;
            this.bar.Brush.Visible              = true;

            this.bar.FillSampleValues(6);

            this.tChart.Series.Add(this.bar);

            this.editGradientButton.Click += editGradientButton_Click;
        }

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region 그라디언트 편집 버튼 클릭시 처리하기 - editGradientButton_Click(sender, e)

        /// <summary>
        /// 그라디언트 편집 버튼 클릭시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void editGradientButton_Click(object sender, EventArgs e)
        {
            GradientEditor editor = new GradientEditor(this.bar.Brush.Gradient);

            editor.ShowDialog();
        }

        #endregion
    }
}
728x90
그리드형(광고전용)
Posted by icodebroker
,