[C#/WINFORM/CHARTDIRECTOR] ThreeDScatterChart 클래스 : 3D Scatter 차트 만들기
■ ThreeDScatterChart 클래스를 사용해 3D Scatter 차트를 만드는 방법을 보여준다. ▶ 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 78 |
using System.Windows.Forms; using ChartDirector; namespace TestProject { /// <summary> /// 메인 폼 /// </summary> public partial class MainForm : Form { //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainForm() /// <summary> /// 생성자 /// </summary> public MainForm() { InitializeComponent(); SetChart(this.viewer); } #endregion //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 차트 설정하기 - SetChart(chartViewer) /// <summary> /// 차트 설정하기 /// </summary> /// <param name="chartViewer">차트 뷰어</param> public void SetChart(WinChartViewer chartViewer) { RanSeries ranSeries = new RanSeries(0); double[] xArray = ranSeries.getSeries2(1000, 100, -10, 10); double[] yArray = ranSeries.getSeries2(1000, 0, 0, 20); double[] zArray = ranSeries.getSeries2(1000, 100, -10, 10); ThreeDScatterChart threeDScatterChart = new ThreeDScatterChart(720, 600); threeDScatterChart.addTitle("3D Scatter 차트", "나눔고딕코딩", 20); threeDScatterChart.setPlotRegion(350, 280, 360, 360, 270); threeDScatterChart.addScatterGroup ( xArray, yArray, zArray, string.Empty, Chart.GlassSphere2Shape, 11, Chart.SameAsMainColor ); threeDScatterChart.setColorAxis(645, 270, Chart.Left, 200, Chart.Right); threeDScatterChart.xAxis().setTitle("X축", "나눔고딕코딩", 10); threeDScatterChart.yAxis().setTitle("Y축", "나눔고딕코딩", 10); threeDScatterChart.zAxis().setTitle("Z축", "나눔고딕코딩", 10); chartViewer.Chart = threeDScatterChart; chartViewer.ImageMap = threeDScatterChart.getHTMLImageMap("clickable", "", "title='<*cdml*>x={x|p}, y={y|p}, z={z|p}'"); } #endregion } } |
TestProject.zip