윈폼에 있는 차트 예제를 정리해 보았다


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
                    //차트 해보자 테스트
 
                    //차트 시리즈1 삭제(초기화)
                    chart1.Series.Clear();
 
                    //시리즈 추가
                    //(각각을 시리즈라하고 Series[0], Series[1]로 표시할 수도 있다
                    chart1.Series.Add("LG");
                    chart1.Series.Add("SPEC");
 
                    //legend 위치
                    //LG, SPEC 두개 시리즈를 합쳐서 하나의 Legends라고 한다 마찬가지로 [0]번지 표시 가능
                    chart1.Legends[0].Alignment = StringAlignment.Center;
                    chart1.Legends[0].Docking = Docking.Bottom;
                    chart2.Legends[0].Alignment = StringAlignment.Center;
                    chart2.Legends[0].Docking = Docking.Bottom;
 
                    //색지정, 스타일 지정
                    // 원래 디폴트 값은 막대이지만 선이나 점선을 하고 싶을때에는 아래와 같이..
                    chart1.Series["SPEC"].ChartType = SeriesChartType.Line;
                    chart1.Series["SPEC"].Color = Color.Red;
                    chart1.Series["SPEC"].BorderWidth = 3;
                    chart1.Series["SPEC"].BorderDashStyle = ChartDashStyle.Dash;
 
                    //포인츠 초기화
                    chart1.Series["LG"].Points.Clear();
 
                    // 값 넣기
                    // LG 시리즈에 1, 100막대를 넣음 AddY()만 써도 
                    chart1.Series["LG"].Points.AddXY(1,100);
 
 
 
cs


'Winform' 카테고리의 다른 글

winform 헤더, 셀 값 가운데로 정렬  (0) 2019.01.30
winform 각 행의 색표시  (0) 2019.01.30
winform 엑셀 저장(초고속)  (0) 2019.01.29
winform 엑셀 죽이기 완벽한 방법  (0) 2019.01.29
winform DataGridView to Excel  (0) 2019.01.22

+ Recent posts