PivotPanel의 각 영역에서 피벗 테이블의 배치 및 순서에 따라 피벗 테이블의 모양이 달라집니다. 사용자는 (행 영역에서처럼) 영역 내에서 필드 값을 위 또는 아래로 끌어 놓아 피벗 테이블에서 맨 처음 나타나는 데이터를 조정할 수 있습니다.
피벗 테이블 필드에는 다음과 같은 4가지 종류의 필드가 있습니다.
피벗 필터 필드
기본적으로 보고서 필터는 피벗 테이블의 맨 위에 단일 세로 목록으로 표시됩니다. 피벗 테이블은 필터 레이아웃을 정의하기 위해 displayFieldsInPageFilterArea
및 reportFilterFieldsPerColumn
옵션을 지원합니다.
GC.Spread.Pivot.DisplayFields
의 열거입니다.export enum GC.Spread.Pivot.DisplayFields {
/**
* prioritize in the vertical direction
*/
downThenOver,
/**
* prioritize in the horizontal direction
*/
overThenDown,
}
피벗 행 필드
행 필드는 피벗 테이블에서 데이터 분산을 정의하고, 행 필드가 여러 개인 경우 트리 모양일 수 있습니다. 행 영역에 필드가 두 개 이상 배치된 경우 확장된 상태로 중첩되어 표시되고 맨 처음으로 순위가 지정된 필드가 첫 번째로 확장됩니다. 레이아웃 유형이 다른 경우 행 필드 모양은 여러 트리 모양을 보여줍니다.
피벗 열 필드
열 필드는 행 필드와 유사합니다. 열 필드가 여러 개인 경우 트리일 수 있습니다. 열 영역에 필드가 두 개 이상 배치된 경우 확장된 상태로 중첩되어 표시되고 맨 처음으로 순위가 지정된 필드가 첫 번째로 확장됩니다.
피벗 값 필드
값 범위는 통계 데이터 영역입니다. 값 영역을 통해 사용자는 피벗 테이블 부분합 유형과 같은 통계 데이터 및 요약 유형을 선택할 수 있습니다.
피벗 테이블 필드는 아래 API를 지원합니다.
1.사용자가 피벗 테이블의 필드에 대한 정렬을 가져오거나 설정할 수 있습니다.
///* function sort(fieldName: string, type?: GC.Pivot.SortType, customSortCallBack?: any): GC.Spread.Pivot.IPivotTableSortInfo | void
/**
* @description get or set sort for a field of pivot table.
* @param {string} fieldName The target field name.
* @param {GC.Pivot.SortType} type The sort type , may be asc or desc
* @param customSortCallBack custom function for custom sort
* @returns GC.Spread.Pivot.IPivotTableSortInfo
*/
sort (fieldName: string, type?: SortType, customSortCallBack?: any): IPivotViewSortInfo | void;
2.사용자가 필드의 항목을 그룹화 또는 그룹 해제할 수 있습니다.
///* function group(fieldName: string, groupInfo: GC.Spread.Pivot.IGroupInfo): void
/**
* @description group the items of field
* @param {string} fieldName the grouped field name
* @param {object} groupInfo the grouped info
*/
group (fieldName: string, groupInfo: any): void;
///* function ungroup(fieldName: string)
/**
* @description ungroup the field by field name
* @param {string} fieldName the ungroup field name
*/
ungroup (fieldName: string);
3.사용자가 피벗 테이블의 필드에 대한 축소 정보를 필드 이름별로 가져오거나 설정할 수 있습니다.
///* function collapse(fieldName: string, item: string, isCollapse?: boolean): boolean | void
/**
* @description get or set collapse info for a field of pivot table.
* @param {string} fieldName The target field name.
* @param {string} item The collapse item name
* @param {boolean} isCollapse the status of the collapse
* @returns {boolean} whether is collapse
*/
collapse (fieldName: string, item: string, isCollapse?: boolean): boolean | void;
4.사용자가 피벗 테이블의 레이블 필터/값 필터 정보를 필드 이름별로 가져오거나 설정할 수 있습니다.
///* function labelFilter(fieldName: string, filterInfo: GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo): GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo | void
/**
* get or set label filter info for a field
* @param {string} fieldName the target field name of pivot table
* @param {object} filterInfo the label filter info when set
* @returns get pivot table labelFilter information
*/
labelFilter (fieldName: string, filterInfo?: IPivotFilterInfo): IPivotFilterInfo | void;
///* function valueFilter(fieldName: string, filterInfo: GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo): GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo | void
/**
* get or set value filter info for a field
* @param {string} fieldName the target field name of pivot table
* @param {object} filterInfo the value filter info when set
* @returns the pivot table value information
*/
valueFilter (fieldName: string, filterInfo?: IPivotFilterInfo): IPivotFilterInfo | void
5.사용자가 피벗 테이블의 부분합 유형을 필드별로 가져오거나 설정할 수 있습니다.
///* function subTotalType (fieldName: string, type?: GC.Pivot.SubtotalType): void
/**
* get or set SubTotalType for a field
* @param {string} fieldName the target field name of pivot table
* @param {GC.Pivot.SubtotalType} type the SubTotalType
* @example
* pivotTable.subTotalType("fieldName", GC.Pivot.SubtotalType)
*/
subTotalType (fieldName: string, type?: SubtotalType): SubtotalType | void;