왜 그랬는지 모르겠지만 그동안 ASP.NET을 사용하면서 Chart 사용이 어렵다고 생각했었다.
그러다 .NET 어플을 만들면서 발견한 Microsoft CHART Controls!!!

사용법부터 설치까지 손쉽게 된다는 강력한 장점이 있다!
VisualStudio 2008의 .Net Framework 3.5 sp1 이상에서만 동작한다는 단점이 있지만 그런 단점 쯤은 쉽게 넘어갈 수 있죠!


MSDN에 보면 아래와 같은 장점들이 있다

  • All supported chart types.
  • Data series, chart areas, axes, legends, labels, titles, and more.
  • Data Binding
  • Data manipulation, such as copying, splitting, merging, alignment, grouping, sorting, searching, filtering, and more.
  • Statistical formulas and financial formulas.
  • Advanced chart appearance, such as 3D, anti-aliasing, lighting, perspective, and more.
  • Chart rendering.
  • Events and Customizations.
  • Interactivity and AJAX.


========================================================================================================================

설치가 완료되면 VS2008의 디자인 창 Toolbox의 Data 카테고리에 Chart가 추가된 것을 확인할 수 있고
간단히 드래그해서 Chart를 그릴수 있다.


Chart Type을 바꾸고 싶으면 Properties의 Series를 선택하면 ChartType 항목이 있다.
이곳에서 마음에 드는 Chart를 선택하면 된다(참~ 쉽죠잉~)

DataBinding 방법은 다양하게 있지만 나는 아래와 같은 방법을 사용했다.


   yvalue는 double값
   xvalue는 string

  int xindex = this.chart1.Series[0].Points.AddY(yvalue);
  this.chart1.Series[xindex].Points.ToolTip = xvalue;

 

출처 : http://haeindaddy.tistory.com/24


'Language > C#' 카테고리의 다른 글

C# :: iTextSharp (PDF 문서 만들기)  (0) 2015.09.17
C# :: SourceGrid  (0) 2015.01.13
C# :: byte[] -> 구조체 , 구조체 -> byte[]  (0) 2012.03.14
C# :: Bootstrapper Manifest Generator  (0) 2011.12.19
C# :: MSChart 설치  (0) 2011.12.19

+ Recent posts