Modules

filter

 

Objects/Functions

module (N/workbook)

SuiteScript 2.0

workbook.createLegend(options)

{workbook}.createLegend({axes: {workbook.ChartAxis[]*},root: {workbook.Section |workbook.DataDimension*},sortDefinitions: {workbook.SortDefinition[]}})

N/workbook Module
workbook.createLegend()
Method Description: Creates a chart legend.
Returns: workbook.Legend
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/workbook Module
Sibling Module Members: N/workbook Module Members
Since: 2020.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=workbook.createLegend(options)

Example:

// Code Example 1
// Add additional code
//...
// Create a basic Legend based on a Section
var myLegend = workbook.createLegend({
axes: [myChartAxis],
root: mySection
});
// Create a basic Legend based on a DataDimension
var myLegend = workbook.createLegend({
axes: [myChartAxis],
root: myDataDimension
});
// Create a sorted Legend
var myLegend = workbook.createLegend({
axes: [myChartAxis],
root: mySection,
sortDefinitions: [mySortDefinition]
});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159051403498.html