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.

·3 min read·View Oracle Docs

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 NameReturn TypeDescription
Chart.aggregationFiltersArray of workbook.LimitingFilter or workbook.ConditionalFilterLimiting and conditional filters for the chart.
Chart.categorystringThe category of the chart.
Chart.datasetdataset.DatasetThe underlying dataset for the chart.
Chart.filterExpressionsArray of workbook.ExpressionThe filter expressions of the chart.
Chart.idstringThe ID of the chart.
Chart.legendworkbook.LegendThe legend representation of the chart.
Chart.namestringThe name assigned to the chart.
Chart.seriesworkbook.SeriesThe series data of the chart.
Chart.stackingstringThe stacking type for the chart.
Chart.subTitlestringThe subtitle associated with the chart.
Chart.titlestringThe main title of the chart.
Chart.typeworkbook.ChartTypeThe 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

suitescript
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: myDataset
10});

Comprehensive Chart Creation

suitescript
1// Create a comprehensive Chart
2var 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: myDataset
15});

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.Chart object is essential for visualizing data in SuiteScript.
  • Key properties include aggregation filters, datasets, and chart types, enabling tailored data representation.
  • The createChart method 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?
The article doesn't mention any specific feature flags that need to be enabled to use Chart object members in SuiteScript.
What permissions are required to create charts using SuiteScript?
The article does not specify the permissions required for creating charts using SuiteScript. Typically, appropriate access to the relevant workspace and datasets would be necessary.
How does the Chart object interact with datasets in SuiteScript?
The Chart object requires a `dataset.Dataset` type as an underlying data source to visualize dataset query results, allowing for the representation of data in different chart forms.
Is the Chart object available in all editions of NetSuite?
The article does not specify whether the Chart object is available in all NetSuite editions. It is advisable to consult the official documentation or your NetSuite account manager for details on availability in specific editions.
Source: Chart Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Platform

View all Platform articles →