■ FastLine 클래스의 DrawAllPoints 속성을 사용해 동일 위치 포인트 그리기를 생략하는 방법을 보여준다.
▶ MainForm.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
using System; using System.Drawing; using System.Windows.Forms; using Steema.TeeChart.Drawing; using Steema.TeeChart.Styles; namespace TestProject { /// <summary> /// 메인 폼 /// </summary> public partial class MainForm : Form { //////////////////////////////////////////////////////////////////////////////////////////////////// Field ////////////////////////////////////////////////////////////////////////////////////////// Private #region Field /// <summary> /// 포인트 수 /// </summary> private const int POINT_COUNT = 100_000; #endregion //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainForm() /// <summary> /// 생성자 /// </summary> public MainForm() { InitializeComponent(); Text = "FastLine 클래스 : DrawAllPoints 속성을 사용해 동일 위치 포인트 그리기 생략하기"; this.tChart.Panel.Pen = new ChartPen(Color.Black); this.tChart.Legend.Visible = false; double[] xValueArray = new double[POINT_COUNT]; double[] yValueArray = new double[POINT_COUNT]; Random random = new Random(); double temporaryValue = random.NextDouble() * 10000; for(int i = 0; i < POINT_COUNT; i++) { temporaryValue += random.Next(100) - 49.5; xValueArray[i] = i; yValueArray[i] = temporaryValue; } FastLine fastLine = new FastLine(); fastLine.Color = Color.Red; fastLine.DrawAllPoints = false; fastLine.XValues.Count = POINT_COUNT; fastLine.XValues.Value = xValueArray; fastLine.YValues.Count = POINT_COUNT; fastLine.YValues.Value = yValueArray; this.tChart.Series.Add(fastLine); fastLine.GetHorizAxis.SetMinMax(0, POINT_COUNT - 1); } #endregion } } |