workbook.Category
Object Description |
A category object which is used when you create a chart definition. Use workbook.createCategory(options) to create this object. |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Module |
|
Methods and Properties |
|
Since |
2020.2 |
Syntax
Important:
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/workbook Module Script Samples. Also see Full scripts in the Tutorial: Creating a Workbook Using the Workbook API topic.
// Add additional code
...
// Create a Category based on a Section
var myCategory = workbook.createCategory({
axis: myChartAxis,
root: mySection,
sortDefinitions: [mySortDefinition]
});
// Create a Category based on a DataDimension
var myCategory = workbook.createCategory({
axis: myChartAxis,
root: myDataDimension,
sortDefinitions: [mySortDefinition]
});
// View a workbook.Category used in a Chart
var myWorkbook = workbook.load ({
id: myWorkbookId
});
var myCategory = myWorkbook.charts[0].category;
// Note that some Category properties may be empty/null based on the loaded workbook
log.audit({
title: 'Category axis = ',
details: myCategory.axis
});
log.audit({
title: 'Category root = ',
details: myCategory.root
});
log.audit({
title: 'Category sortDefinitions = ',
details: myCategory.sortDefinitions
});
...
// Add additional code