Javascript2013. 10. 2. 13:41

1. tchart object 추가...추가된 오브젝트 명이 Chart1일경우.

 

//차트의 상, 좌, 우, 하의 여백을 설정한다.
     Chart1.Panel.MarginTop = 0;
     Chart1.Panel.MarginLeft = 0;
     Chart1.Panel.MarginRight =0;
     Chart1.Panel.MarginBottom = 0;

   

     Chart1.Panel.BevelWidth = 0;        // 주위 테두리 넓이 0으로 설정

     Chart1.Header.Visible = false;      // Graph Header 정보 사용 여부
     Chart1.Aspect.View3D  = false;      // 2d 로 표현하기

    

    Chart1.Zoom.Enable  = true;        // zoom여부 마우스 하단으로 드래그 zoomin, 마우스 상단으로 드래그 zoomout)
     Chart1.Scroll.Enable   = true;      // scroll 사용하지 않기
     Chart1.Legend.Visible  = true;     // 그래프 참조 박스 띄우지 않기(범례) 우측상단
     

     Chart1.Panel.Gradient.Visible = true;      // 페널에 그라디언트 적용
     Chart1.Panel.Gradient.StartColor = 0x404040;  // 그라디언트 시작색깔
     Chart1.Panel.Gradient.EndColor = 0x404040;   // 그라디언트 종료색깔
     Chart1.Environment.MouseWheelScroll = true;   // Graph 마우스 휠 사용 여부

     //하단축 칸 수 정하기와 눈금 없애기
     Chart1.Axis.Bottom.Automatic = false;    //하단축 자동 설정(기본값)
     Chart1.Axis.Bottom.Labels.Visible = true;   //하단축 Label 설정
     Chart1.Axis.Bottom.Labels.multiline = true; //하단축 Label 2줄 설정
     Chart1.Axis.Bottom.Labels.Font.Size = 1; //하단축 Label 폰트 사이즈 조절

     //Chart1.Axis.Bottom.SetMinMax (0, 24);  //하단축 최소, 최대 길이 설정
     Chart1.Axis.Bottom.Minimum = 0;
     Chart1.Axis.Bottom.Maximum = length + 4;
     Chart1.Axis.Bottom.Increment = 2;    //하단축 증가값 설정
     Chart1.Axis.Bottom.MinorTickCount = 20;  //하단축 눈금 갯수 설정
     Chart1.Axis.Bottom.TicksInner.visible = false; //하단축 눈금 안쪽 표시 설정
     
     Chart1.Axis.Visible = true;
     Chart1.Header.Text.Add("My FirstLine");

 

//차트 생성부분

//차트 생성시에 AddSeries()안의 파라메터의 종류에 따라 추가되는 그래프의 종류가 달라진다.

//0: 라인그래프 1 : 막대그래프. 5: 파이그래프.

for(var i = 0; i < length; i++) {
      Chart1.AddSeries(1);
      Chart1.Series(i).Color = aColor[i]; //생성한 차트축의 색상. ex) 0xff0000

      Chart1.Series(i).asBar.BarStyle = 0; //bar의 모양.
      Chart1.Series(i).asBar.BarWidth = 5; //bar의 굵기
      Chart1.Series(i).Title = grd_inpt.valueMatrix(i+1, grd_inpt.colRef("deptengabbr")); //bar축의 이름
      Chart1.Series(i).AddXY(i +3, parseInt(grd_inpt.valueMatrix(i +1, grd_inpt.colRef("gadong"))),"", aColor[i]);

     //막대차트는 AddXY함수를 이용하여 그린다.

    //Chart1.Series(0).AddXY(  x축의 값   ,  Y축값, "", 막대색깔); //3번째 파라메터는 사실 모르겠다.


     }

 

Chart2.AddSeries(5);
     
     Chart2.Series(0).Add(100, "5급", aColor[0]);
     Chart2.Series(0).Add(80, "4급", aColor[1]);
     Chart2.Series(0).Add(20, "3급", aColor[2]);
     Chart2.Series(0).Add(10, "2급", aColor[3]);

 


 

Posted by 달려라곰간지