2013-03-25 3 views
0

MS 차트 기능을 사용하여 XY 차트를 플롯해야합니다. 각기 다른 X 및 Y 좌표와 다른 표식 스타일이있는 5 개의 다른 점을 그립니다. 따라서이 경우 X 및 Y 점 모두를 플롯해야합니다.MS 차트를 사용하여 프로그래밍 방식으로 점 차트를 그리는 중 오류가 발생했습니다.

도와주세요. '포인트'차트를 사용해 보았지만 어떻게 든 나에게 도움이되지 않습니다.

미리 감사드립니다.

답변

0

이런 식으로 뭔가 ...

 //// initialize an array of doubles for Y values 
     double[] yval = { 5, 6, 4, 6, 3 }; 
     // initialize an array of strings for X values 
     double[] xval = { 1, 4, 6, 8, 9 }; 
     // bind the arrays to the X and Y values of data points in the "ByArray" series 
     chart1.Series["Series1"].Points.DataBindXY(xval, yval); 
     chart1.Series["Series1"].ChartType = SeriesChartType.Point; 
     chart1.Series["Series1"].Points[0].MarkerStyle = MarkerStyle.Square; 
     chart1.Series["Series1"].Points[1].MarkerStyle = MarkerStyle.Cross; 
     chart1.Series["Series1"].Points[2].MarkerStyle = MarkerStyle.Triangle; 
     chart1.Series["Series1"].Points[3].MarkerStyle = MarkerStyle.Circle; 
     chart1.Series["Series1"].Points[4].MarkerStyle = MarkerStyle.Star4;