Class DataSourceChart

DataSourceChart

기존 데이터 소스 차트에 액세스하고 수정합니다.

데이터베이스에 연결된 데이터에만 이 클래스를 사용합니다.

메서드

메서드반환 유형간략한 설명
cancelDataRefresh()DataSourceChart현재 실행 중인 경우 이 객체와 연결된 데이터 새로고침을 취소합니다.
forceRefreshData()DataSourceChart현재 상태에 관계없이 이 객체의 데이터를 새로고침합니다.
getDataSource()DataSource객체가 연결된 데이터 소스를 가져옵니다.
getStatus()DataExecutionStatus객체의 데이터 실행 상태를 가져옵니다.
refreshData()DataSourceChart객체의 데이터를 새로고침합니다.
waitForCompletion(timeoutInSeconds)DataExecutionStatus현재 실행이 완료될 때까지 대기하며 지정된 시간(초) 후에 타임아웃됩니다.

자세한 문서

cancelDataRefresh()

현재 실행 중인 경우 이 객체와 연결된 데이터 새로고침을 취소합니다.

이 예에서는 수식 새로고침을 취소하는 방법을 보여줍니다.

const spreadsheet = SpreadsheetApp.getActive();
const formula = spreadsheet.getDataSourceFormulas()[0];
// Cancel the ongoing refresh on the formula.
formula.cancelDataRefresh();

데이터 소스 유형이 사용 설정되지 않은 경우 예외가 발생합니다. SpreadsheetApp#enable...Execution() 메서드를 사용하여 특정 데이터 소스 유형의 데이터 실행을 사용 설정합니다.

리턴

DataSourceChart - 데이터 객체입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상의 인증이 필요합니다.

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

forceRefreshData()

현재 상태에 관계없이 이 객체의 데이터를 새로고침합니다. 자세한 내용은 refreshData()를 참고하세요. 현재 실행 중인 이 객체의 새로고침을 취소하려면 cancelDataRefresh()를 참고하세요.

데이터 소스 유형이 사용 설정되지 않은 경우 예외가 발생합니다. SpreadsheetApp#enable...Execution() 메서드를 사용하여 특정 데이터 소스 유형의 데이터 실행을 사용 설정합니다.

리턴

DataSourceChart - 데이터 객체입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상의 인증이 필요합니다.

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSource()

객체가 연결된 데이터 소스를 가져옵니다.

리턴

DataSource - 데이터 소스입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상의 인증이 필요합니다.

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getStatus()

객체의 데이터 실행 상태를 가져옵니다.

리턴

DataExecutionStatus - 데이터 실행 상태입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상의 인증이 필요합니다.

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

refreshData()

객체의 데이터를 새로고침합니다.

현재 error 상태인 경우 예외가 발생합니다. DataSource#updateSpec()를 사용하여 사양을 업데이트합니다. 데이터 소스가 예기치 않게 수정되지 않도록 하려면 forceRefreshData()보다 이 방법을 사용하는 것이 좋습니다.

데이터 소스 유형이 사용 설정되지 않은 경우 예외가 발생합니다. SpreadsheetApp#enable...Execution() 메서드를 사용하여 특정 데이터 소스 유형의 데이터 실행을 사용 설정합니다.

리턴

DataSourceChart - 데이터 객체입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상의 인증이 필요합니다.

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

waitForCompletion(timeoutInSeconds)

현재 실행이 완료될 때까지 대기하며 지정된 시간(초) 후에 타임아웃됩니다. 시간 초과 시 실행이 완료되지 않았지만 데이터 실행을 취소하지 않으면 예외가 발생합니다.

매개변수

이름유형설명
timeoutInSecondsInteger데이터 실행을 기다리는 시간(초)입니다. 최댓값은 300초입니다.

리턴

DataExecutionStatus - 데이터 실행 상태입니다.

승인

이 방법을 사용하는 스크립트에는 다음 범위 중 하나 이상의 인증이 필요합니다.

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets