Class Slicer
자세한 문서
getBackgroundColorObject()
슬라이서의 배경 Color
를 반환합니다.
리턴
Color
: 이 슬라이서의 배경 색상입니다. 색상이 설정되지 않은 경우 null
을 반환합니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getColumnPosition()
슬라이서에서 필터가 적용되는 열 위치 (슬라이서의 데이터 범위 기준)를 반환하거나 열 위치가 설정되지 않은 경우 null
을 반환합니다. 필터와 마찬가지로 열의 1-인덱스 위치여야 합니다.
리턴
Integer
: 이 슬라이서의 열 위치입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getContainerInfo()
시트에서 슬라이서가 배치된 위치에 관한 정보를 가져옵니다.
리턴
ContainerInfo
: 슬라이서 컨테이너 위치가 포함된 객체입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFilterCriteria()
슬라이서의 필터 기준을 반환하거나 필터 기준이 설정되지 않은 경우 null
를 반환합니다.
리턴
FilterCriteria
: 이 슬라이서의 필터 기준입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRange()
슬라이서가 적용되는 데이터 범위를 가져옵니다.
리턴
Range
- 슬라이서 범위입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getTitle()
슬라이서의 제목을 반환합니다.
리턴
String
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getTitleHorizontalAlignment()
제목의 가로 정렬을 가져옵니다.
리턴
String
: 이 슬라이서의 제목의 가로 정렬입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getTitleTextStyle()
슬라이서 제목의 텍스트 스타일을 반환합니다.
리턴
TextStyle
: 이 슬라이서의 제목의 텍스트 스타일입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isAppliedToPivotTables()
지정된 슬라이서가 피벗 테이블에 적용되는지 여부를 반환합니다.
리턴
Boolean
: 이 슬라이서가 피벗 테이블에 적용된 경우 true
이고, 그렇지 않은 경우에는 false
입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
remove()
슬라이서를 삭제합니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setApplyToPivotTables(applyToPivotTables)
지정된 슬라이서를 워크시트의 피벗 테이블에 적용할지 설정합니다.
매개변수
이름 | 유형 | 설명 |
applyToPivotTables | Boolean | 이 슬라이서를 피벗 테이블에 적용할지 여부를 지정합니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setBackgroundColor(color)
슬라이서의 배경 색상을 설정합니다. null
값은 배경 색상을 재설정합니다.
매개변수
이름 | 유형 | 설명 |
color | String | 이 슬라이서의 새 배경 색상 (CSS 표기법: '#ffffff')입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setBackgroundColorObject(color)
슬라이서의 배경 Color
를 설정합니다. null
값은 배경 색상을 재설정합니다.
매개변수
이름 | 유형 | 설명 |
color | Color | 이 슬라이서의 새 배경 색상입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setColumnFilterCriteria(columnPosition, filterCriteria)
슬라이서의 열 색인 및 필터링 기준을 설정합니다. null
값은 슬라이서 필터를 재설정합니다.
매개변수
이름 | 유형 | 설명 |
columnPosition | Integer | 이 슬라이서의 새 열 위치입니다. |
filterCriteria | FilterCriteria | 이 슬라이서의 새 필터 기준입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)
시트에 슬라이서가 표시되는 위치를 설정합니다. 앵커 행 및 열 위치 색인은 1부터 시작합니다.
매개변수
이름 | 유형 | 설명 |
anchorRowPos | Integer | 슬라이서의 상단이 이 행에 고정됩니다. |
anchorColPos | Integer | 슬라이서의 상단이 이 열에 고정됩니다. |
offsetX | Integer | 셀 모서리에서 가로로 떨어진 오프셋(단위: 픽셀)입니다. |
offsetY | Integer | 셀 모서리에서 세로로 떨어진 오프셋(단위: 픽셀)입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRange(rangeApi)
슬라이서가 적용되는 데이터 범위를 설정합니다.
매개변수
이름 | 유형 | 설명 |
rangeApi | Range | 이 슬라이서의 새 범위입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setTitle(title)
슬라이서의 제목을 설정합니다. 제목이 비어 있으면 제목이 기본값으로 재설정됩니다.
매개변수
이름 | 유형 | 설명 |
title | String | 이 슬라이서의 새 제목입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setTitleHorizontalAlignment(horizontalAlignment)
슬라이서에서 제목의 가로 정렬을 설정합니다. null
값은 정렬을 재설정합니다.
매개변수
이름 | 유형 | 설명 |
horizontalAlignment | String | 이 슬라이서의 제목의 새 가로 정렬입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setTitleTextStyle(textStyle)
슬라이서의 텍스트 스타일을 설정합니다.
매개변수
이름 | 유형 | 설명 |
textStyle | TextStyle | 슬라이서의 제목의 새 텍스트 스타일입니다. |
리턴
Slicer
: 체이닝을 위한 슬라이서입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
지원 중단된 메서드
getBackgroundColor()
지원 중단되었습니다. getBackgroundColorObject()
로 대체됨
CSS 표기법 (예: '#ffffff')으로 슬라이서의 배경 색상을 반환합니다.
리턴
String
: 이 슬라이서의 배경 색상입니다. 색상이 설정되지 않은 경우 null
을 반환합니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-12-03(UTC)
[null,null,["최종 업데이트: 2024-12-03(UTC)"],[[["The `Slicer` class allows you to programmatically control slicers in Google Sheets, enabling you to filter data in ranges, charts, and pivot tables without collaboration."],["You can access and modify existing slicers or create new ones using the provided methods, such as setting the data range, background color, title, and position."],["The `Slicer` class offers various methods for customizing the slicer's appearance, including setting the background color, title alignment, and text style."],["To use the `Slicer` class effectively, you will need to authorize your script with the necessary scopes to access and modify spreadsheet data."],["Several methods are available for interacting with the slicer's filter criteria, allowing you to retrieve, set, and manipulate the filtering conditions applied to the data."]]],["Slicers filter ranges, charts, and pivot tables. Key actions include: retrieving and modifying slicer properties like background color, column position, filter criteria, data range, and title. Slicers can be positioned and have their applicability to pivot tables set. You can also manage the title's horizontal alignment and text style. Slicers are created using `Sheet.insertSlicer`. The method to remove a slicer is `remove()`. The old method to obtain background colors is deprecated and should be replaced by `getBackgroundColorObject()`.\n"]]