Chart Object Members in SuiteScript for Data Visualization
Chart object members in SuiteScript provide essential properties for data visualization. Learn how to create and customize charts with various attributes.
TL;DR
Chart object members in SuiteScript allow for robust handling of data visualization through various attributes. This functionality enhances the ability to create and customize charts in NetSuite workbooks, making data insights more accessible.
What Are Chart Object Members?
The Chart object in SuiteScript is a key element used for visualizing dataset query results. This object allows developers to create various chart types, including bar and line graphs, and is instrumental in making data more understandable.
Key Members of the Chart Object
Below are the primary members available for the workbook.Chart object:
| Member Name | Return Type | Description |
|---|---|---|
Chart.aggregationFilters | Array of workbook.LimitingFilter or workbook.ConditionalFilter | Limiting and conditional filters for the chart. |
Chart.category | string | The category of the chart. |
Chart.dataset | dataset.Dataset | The underlying dataset for the chart. |
Chart.filterExpressions | Array of workbook.Expression | The filter expressions of the chart. |
Chart.id | string | The ID of the chart. |
Chart.legend | workbook.Legend | The legend representation of the chart. |
Chart.name | string | The name assigned to the chart. |
Chart.series | workbook.Series | The series data of the chart. |
Chart.stacking | string | The stacking type for the chart. |
Chart.subTitle | string | The subtitle associated with the chart. |
Chart.title | string | The main title of the chart. |
Chart.type | workbook.ChartType | The specific type of the chart. |
How to Create a Chart
To define a chart in SuiteScript, utilize the workbook.createChart() method, which allows you to customize various properties in your chart configuration. Below is an example illustrating both a basic and a more comprehensive chart creation:
Basic Chart Creation
1// Create a basic Chart 2var myChart = workbook.createChart({3 name: 'myChart',4 id: '_myChart',5 type: workbook.ChartType.BAR,6 category: myCategory,7 legend: myLegend,8 series: [mySeries],9 dataset: myDataset10});Comprehensive Chart Creation
1// Create a comprehensive Chart2var myChart = workbook.createChart({3 name: 'myChart',4 title: 'My Chart Title',5 subTitle: 'My Chart Subtitle',6 id: '_myChart',7 type: workbook.ChartType.BAR,8 stacking: workbook.Stacking.PERCENT,9 category: myCategory,10 legend: myLegend,11 series: [mySeries],12 filterExpressions: [myExpression],13 aggregationFilters: [myLimitingFilter],14 dataset: myDataset15});Who This Affects
- Developers: Understanding how to utilize chart objects can enhance reporting and data visualization in applications.
- Administrators: Customizing and configuring charts will improve insight generation from data queries.
Key Takeaways
- The
workbook.Chartobject is essential for visualizing data in SuiteScript. - Key properties include aggregation filters, datasets, and chart types, enabling tailored data representation.
- The
createChartmethod provides flexibility in chart creation for better analytics.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Do I need to enable any feature flags to use Chart object members in SuiteScript?
What permissions are required to create charts using SuiteScript?
How does the Chart object interact with datasets in SuiteScript?
Is the Chart object available in all editions of NetSuite?
Was this article helpful?
More in Platform
- Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- In This Help Topic
Explore N/log module guidelines, log levels, and script execution logs for efficient logging in SuiteScript.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category