123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- /************************************************************************************************
- DATE : 2007-07-06
- WRITER : Comsquare
- DEFINITION : TrustForm4.0 TChart 관련 공통 JavaScript ( CMC )
- *************************************************************************************************/
- /************************************************************************************************
- 함수명 : createTChart ()
- 인자 :
- String objID - 생성될 TChart Object ID
- Integer leftPx - Left
- Integer topPx - Top
- Integer widthPx - Width
- Integer heightPx - Height
- [Object parentObj] - 생성될 타겟(부모 객체)
-
- 결과값 : Object TChart
- 함수설명 : TChart Control 생성
- ************************************************************************************************
- 작 성 자 : 김 기용
- 작 성 일 : 2007. 07. 06
- ************************************************************************************************/
- function createTChart(objID, leftPx, topPx, widthPx, heightPx, parentObj) {
- if( parentObj == null )
- parentObj = body;
- var tChartObj = parentObj.createChild("xforms:object", "id:" + objID + "; clsid:{fab9b41c-87d6-474d-ab7e-f07d78f2422e}; left:" + leftPx + "px; top:" + topPx + "px; width:" + widthPx + "px; height:" + heightPx + "px; ")
- return tChartObj;
- }
- /************************************************************************************************
- 함수명 : drawOneTChart ()
- 인자 :
- Object tChartObj - Target TChart
- Object gridObj - Source DataGrid
- Integer row - Datagrid Source row
- [String title] - TChart Title
- [Boolean refresh] - 초기화 여부
-
- 결과값 :
- 함수설명 : Datagrid의 해당 로우 data를 반영하여 TChart에(Point Type) 그려 줌.
- ************************************************************************************************
- 작 성 자 : 김 기용
- 작 성 일 : 2007. 07. 06
- ************************************************************************************************/
- function drawOneTChart(tChartObj, gridObj, row, title, refresh) {
-
- if( refresh )
- tChartObj.RemoveAllSeries(); // Series 초기화
-
- if( title != null || title == "" ) {
- tChartObj.Header.Text(0) = title; // Title 설정
- }
-
- tChartObj.Aspect.View3D = 0; // 3D 설정
-
- tChartObj.Legend.CheckBoxes = true;
- // tChartObj.Legend.Alignment = 0; // Legend 위치 설정 :: 0 - left | 1 - right | 2 - top| 3 - bottom
-
- var Rnd1, Rnd2, Rnd3;
- var cColor;
- var i;
- var x, y;
-
- tChartObj.AddSeries(0);
-
- var seriesIndex = tChartObj.SeriesCount - 1;
- var trgRow = row;
-
- tChartObj.Series(seriesIndex).asLine.Pointer.Visible = true;
- tChartObj.Series(seriesIndex).asLine.Pointer.Style = 1; //PointStyle 설정 :: 0 - 8
- tChartObj.Series(seriesIndex).Title = datagrid1.valueMatrix(trgRow, 0);
-
- //tChartObj.Series(cline - 2).Marks.Style = 0;
- Rnd1 = Math.random();
- Rnd2 = Math.random();
- Rnd3 = Math.random();
- cColor = window.rgb( (255 - 1) * Rnd1 + 1, (255 - 1) * Rnd2 + 1 , (255 - 1) * Rnd3 + 1);
-
- for( i = gridObj.fixedCols; i < gridObj.cols; i++ ){
-
- x = gridObj.valueMatrix(0, i);
- y = gridObj.valueMatrix(trgRow, i);
- tChartObj.Series(seriesIndex).Add (y, x, tChartObj.Series(seriesIndex).Color);
- // tChartObj.Series(seriesIndex).LegendItemColor(cColor);
- }
- }
- /************************************************************************************************
- 함수명 : drawAllTChart ()
- 인자 :
- Object tChartObj - Target TChart
- Object gridObj - Source DataGrid
- String title - TChart Title
-
- 결과값 :
- 함수설명 : Datagrid data를 반영하여 TChart에(Point Type) 그려 줌.
- ************************************************************************************************
- 작 성 자 : 김 기용
- 작 성 일 : 2007. 07. 06
- ************************************************************************************************/
- function drawAllTChart(tChartObj, gridObj, title) {
- tChartObj.RemoveAllSeries(); // Series 초기화
- for( var i = gridObj.fixedRows; i < gridObj.rows; i ++)
- drawOneTChart(tChartObj, gridObj, i, title, false);
- }
|