블로그 이미지
프로그램을 가장 훌륭하게 작성하는 방법은 상태가 변경되는 오브젝트들과 수학적인 값을 나타내는 오브젝트들의 조합으로 표현하는 것이다. -Kent Beck 초초초보

카테고리

Programming (184)
ASP.NET (9)
Silverlight (2)
Javascript (20)
C# (8)
java (25)
SQL (14)
Oracle (3)
MyBatis (3)
기타 (52)
개발방법론 (1)
trouble shooting (2)
Linux (5)
스칼라 (5)
html (2)
grails & gradle (3)
Spring (2)
rabbitmq (1)
(3)
spark (0)
docker (3)
Total
Today
Yesterday

달력

« » 2024.5
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

공지사항

최근에 올라온 글

'Programming'에 해당되는 글 184건

  1. 2008.12.04 Chart Control 시작하기 3
  2. 2008.12.04 Chart Control 시작하기 2
  3. 2008.12.04 Chart Control 시작하기 1
  4. 2008.12.04 ASP.NET Chart Control 사용하기(환경설정)

Chart Control 시작하기 3

ASP.NET / 2008. 12. 4. 14:24
Chart Control을 조금 더 뽀대나가 3D 로 만들어 보기다.(별로 이쁘진 않은것 같음)

Chart Control의 3D 설정은 2가지 방법이 있는데 cs 에서 하는 방법과 html 에서 하는 방법이 있다.

먼저 cs 에서 하는 방법은

Chart1.ChartAreas[0].Area3DStyle.Enable3D = true;

--> 차트컨트롤ID.CharAreas[Name 또는 인덱스].Area3DStyle.Enable3D = boolean;

html 에서 하는 방법은

<Area3DStyle Enable3D=true />


3D의 속성은 현재 10가지가 있다.
아래 표는 ChartArea3DStyle class의 10가지 속성이다.
 Enable3D  3D 를 사용 할 것인지(Bool)
 Inclination  Y축 회전(int)
 Rotation  X축 회전(int)
 IsClustered 같은 종류의 컬럼끼리 묶기
 IsRightAngleAxes  잘 모름(bool)
 LightStyle  조명 정하기(LightStyle)
 Perspective  원근감(int)
 PointDepth  얼마나 3D 효과를 줄 것인지?(int)
 PointGapDepth  앞 뒤 막대들 사이의 거리(int)
 WallWidth  벽 두께. 차트를 약간 기울이고 보면 벽이 생기는걸 확인 할 수 있음(int)

실제 적용된 소스를 보면

                <asp:Chart ID="Chart1" runat="server" Palette="BrightPastel"
                    BackColor="#F3DFC1" Width="412px" Height="296"
                    BorderlineDashStyle="Solid" BackGradientStyle="TopBottom"
                    BorderlineWidth="2" BorderlineColor="181, 64, 1">
                        <Titles>
                            <asp:Title ShadowColor="32,0,0,0"
                            Font="Trebuchet MS, 14.24pt, style=Bold"
                            ShadowOffset="3" Text="Column Chart" Name="Title1"
                            ForeColor="26, 59, 105"></asp:Title>  
                        </Titles>
                        <Legends>
                            <asp:Legend TitleFont="Microsoft Sans Serif, 8pt, style=Bold"
                            BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style=Bold"
                            IsTextAutoFit="false" Enabled="false" Name="Default">
                            </asp:Legend>
                        </Legends>
                        <BorderSkin SkinStyle="Emboss" />
                        <Series>
                            <asp:Series XValueType="DateTime" Name="Series1"
                            BorderColor="180, 26, 59, 105">
                                <Points>
                                    <asp:DataPoint XValue="36890" YValues="32" />
                                    <asp:DataPoint XValue="36891" YValues="56" />
                                    <asp:DataPoint XValue="36892" YValues="35" />
                                    <asp:DataPoint XValue="36893" YValues="12" />
                                    <asp:DataPoint XValue="36894" YValues="35" />
                                    <asp:DataPoint XValue="36895" YValues="6" />
                                    <asp:DataPoint XValue="36896" YValues="23" />
                                </Points>
                            </asp:Series>
                            <asp:Series XValueType="DateTime" Name="Series2"
                            BorderColor="180,26,59,105">
                                <Points>
                                    <asp:DataPoint XValue="36890" YValues="67" />
                                    <asp:DataPoint XValue="36891" YValues="24" />
                                    <asp:DataPoint XValue="36892" YValues="12" />
                                    <asp:DataPoint XValue="36893" YValues="8" />
                                    <asp:DataPoint XValue="36894" YValues="46" />
                                    <asp:DataPoint XValue="36895" YValues="14" />
                                    <asp:DataPoint XValue="36896" YValues="76" />
                                </Points>
                            </asp:Series>
                        </Series>
                        <ChartAreas>
                            <asp:ChartArea Name="ChartArea1">
                               //3D 스타일 설정하는 부분                           
                                <Area3DStyle Rotation="10" Perspective="10" Inclination="15"
                                IsRightAngleAxes="false" Enable3D="true" WallWidth="0" PointDepth="100"
                                IsClustered="false" PointGapDepth="300" />
                                <AxisY>
                                    <LabelStyle
                                    Format="C0" />
                                    <MajorGrid LineColor="64,64,64,64" />
                                </AxisY>
                                <AxisX>
                                    <LabelStyle
                                    Format="MM-dd" />
                                    <MajorGrid LineColor="64,64,64,64" />
                                </AxisX>
                            </asp:ChartArea> 
                        </ChartAreas>
                    </asp:Chart>  


다음과 같은 3D 차트가 나오게 된다.







Posted by 초초초보
, |

Chart Control 시작하기 2

ASP.NET / 2008. 12. 4. 13:01

Chart Control 에 속성 값을 줘서 디자인을 꾸미는 방법이다.

Chart 클래스에서 몇 가지의 속성을 나열 해보면

 BackColor  배경색 지정
 BackGradientStyle  배경의 변화도
 BackHatchStyle  배경 무늬(?) (개인적인 생각으로는 이걸 설정하면 되게 안이쁘게 나옴)
 BackImage  배경 이미지
 BorderColor  테두리 색깔
 BorderWidth  테두리 두깨
 Height  높이
 BackSecondaryColor  배경색(2번째 색)(BackColor 와 함께 배경을 이룸)
 ImageLocation 렌더링 될 때 이미지 파일이 저장될 경로
 Palette  말 그대로 빠레트(?) 어느 파레트에 그릴 것인가.
 Width  길이

훨씬 많지만 간단히 꾸밀 수 있는 속성 값은 이정도 이다.

실제 적용된 html 소스를 보면
                    <asp:Chart ID="Chart1" runat="server" Palette="BrightPastel" 
                    BackColor="#F3DFC1" Width="412px" Height="296"
                    BorderlineDashStyle="Solid" BackGradientStyle="TopBottom"
                    BorderlineWidth="2" BorderlineColor="181, 64, 1">
                        <Titles> //차트에 타이틀을 설정한다.
                            <asp:Title ShadowColor="32,0,0,0"
                            Font="Trebuchet MS, 14.24pt, style=Bold"
                            ShadowOffset="3" Text="Column Chart" Name="Title1"
                            ForeColor="26, 59, 105"></asp:Title>  
                        </Titles>
                        <Legends> //설명을 설정한다.
                            <asp:Legend TitleFont="Microsoft Sans Serif, 8pt, style=Bold"
                            BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style=Bold"
                            IsTextAutoFit="false" Enabled="false" Name="Default">
                            </asp:Legend>
                        </Legends>
                        <BorderSkin SkinStyle="Emboss" /> //테두리에 스킨을 입혔다.
                        <Series> //데이터를 입력하는 곳 : 기본적으로 Chart 컨트롤은
                                                           Series 를 만들어서 데이터를 입력한다

                            <asp:Series XValueType="DateTime" Name="Series1"
                            BorderColor="180, 26, 59, 105">
                                <Points> //데이터를 임의로 넣었다.
                                    <asp:DataPoint XValue="36890" YValues="32" />
                                    <asp:DataPoint XValue="36891" YValues="56" />
                                    <asp:DataPoint XValue="36892" YValues="35" />
                                    <asp:DataPoint XValue="36893" YValues="12" />
                                    <asp:DataPoint XValue="36894" YValues="35" />
                                    <asp:DataPoint XValue="36895" YValues="6" />
                                    <asp:DataPoint XValue="36896" YValues="23" />
                                </Points>
                            </asp:Series>
                            <asp:Series XValueType="DateTime" Name="Series2"
                            BorderColor="180,26,59,105">
                                <Points>
                                    <asp:DataPoint XValue="36890" YValues="67" />
                                    <asp:DataPoint XValue="36891" YValues="24" />
                                    <asp:DataPoint XValue="36892" YValues="12" />
                                    <asp:DataPoint XValue="36893" YValues="8" />
                                    <asp:DataPoint XValue="36894" YValues="46" />
                                    <asp:DataPoint XValue="36895" YValues="14" />
                                    <asp:DataPoint XValue="36896" YValues="76" />
                                </Points>
                            </asp:Series>
                        </Series>
                        <ChartAreas> //차트를 뿌릴 공간
                            <asp:ChartArea Name="ChartArea1" BorderColor="64,64,64,64"
                            BackSecondaryColor="White" BackColor="OldLace"
                            ShadowColor="Transparent" BackGradientStyle="TopBottom">
                                <Area3DStyle Rotation="10" Perspective="10" Inclination="15"
                                IsRightAngleAxes="false" WallWidth="0"
                                IsClustered="false" />
                                <AxisY LineColor="64,64,64,64" LabelAutoFitMaxFontSize="8">
                                    <LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold"
                                    Format="C0" />
                                    <MajorGrid LineColor="64,64,64,64" />
                                </AxisY>
                                <AxisX LineColor="64,64,64,64" LabelAutoFitMaxFontSize="8">
                                    <LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold"
                                    Format="MM-dd" />
                                    <MajorGrid LineColor="64,64,64,64" />
                                </AxisX>
                            </asp:ChartArea> 
                        </ChartAreas>
                    </asp:Chart>  

CS 코드는 따로 작성하지 않았다.
적용된 디자인을 살펴보면



이렇게 적용 되었다. (예제 소스랑 똑같이 만든 차트임)










Posted by 초초초보
, |

Chart Control 시작하기 1

ASP.NET / 2008. 12. 4. 12:28

Chart Control을 간단히 만들고 데이터를 넣어 보는 방법이다.

먼저 html 에서

        <asp:Chart runat="server" ID="Chart1">
            <ChartAreas>// 차트가 표시될 공간
                <asp:ChartArea> 
                    <AxisX></AxisX> 
                    <AxisY></AxisY>
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>

이런 식으로 작성 한 후에(데이터가 나오기 위한 최소값만 작성)

CS 파일에서

            int[] yval = { 1,6,3,7,3,6,2}; //데이터를 넣기위한 데이터 소스(IEnumarable 형태)

            Chart1.Series.Add("Series1");// 새로운 Series를 만든다.
            Chart1.Series["Series1"].Points.DataBindY(yval); // 데이터를 바인딩 시킨다


실행을 시켜보면




이런 아주 간단한 Chart가 나오게 된다.
















Posted by 초초초보
, |
ASP.NET  Chart Control 사용하기

1. Visual Studio 2008 sp1 설치
2. 여기 에서
        - Download the free Microsoft Chart Controls 
        - Download the VS 2008 Tool Support for the Chart Controls 
이렇게 두개를 다운 받아 설치 한 후
샘플코드를 다운 받아서 어떻게 구현 하는지 살펴본다.(시작 페이지는 default.aspx 로 설정 )

SDK는 
       - Download the Microsoft Chart Controls Documentation
이걸 다운 받으면 된다.

여러 사람들의 글과 Chart Control에 대해서 토론하는 장소는(주로 질문이 많이 올라오는 듯)
      - Visit the Microsoft Chart Control Forum 
여기로 가면 된다

Posted by 초초초보
, |