Метод Chart:applySettings
Метод позволяет обновить параметры диаграммы.
Вызов
applySettings(cellRange, directionType, title, labelsInfo)
Параметры
‒ cellRange – обновленный диапазон исходных данных диаграммы DocumentAPI.CellRange;
‒ directionType – направление серий DocumentAPI.ChartSeriesDirectionType;
‒ title – заголовок диаграммы (тип - строка);
‒ labelsInfo – информация о метках диаграммы DocumentAPI.ChartLabelsInfo.
Пример
local tbl = document:getBlocks():getTable(0)
local charts = tbl:getCharts()
local cellRange = tbl:getCellRange("B3:C4")
local directionType = DocumentAPI.ChartSeriesDirectionType_ByRow
local title = 'Title'
local chartLabelsInfo = DocumentAPI.ChartLabelsInfo(DocumentAPI.ChartLabelsDetectionMode_FirstRow, DocumentAPI.ChartLabelsDetectionMode_FirstRow, false)
charts:getChart(0):applySettings(cellRange, directionType, title, chartLabelsInfo)