■ Chart 클래스에서 차트 영역을 분할하는 방법을 보여준다.
▶ 예제 코드 (C#)
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 |
using System; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; Chart chart = new Chart(); chart.Dock = DockStyle.Fill; Controls.Add(chart); chart.ChartAreas.Add("ChartArea1"); Random random = new Random(DateTime.Now.Millisecond); Series series1 = chart.Series.Add("Series1"); series1.ChartArea = "ChartArea1"; series1.ChartType = SeriesChartType.Column; for(int i = 0; i < 10; i++) { series1.Points.Add(random.Next(500)); } chart.ChartAreas.Add("ChartArea2"); Series series2 = chart.Series.Add("Series2"); series2.ChartArea = "ChartArea2"; series2.ChartType = SeriesChartType.Column; for(int i = 0; i < 10; i++) { series2.Points.Add(random.Next(500)); } |