Class ChartOptions

  • ChartOptions provides access to the configuration settings of a Chart, such as height and color, and these options cannot be changed once set.

  • To understand available options, refer to the visualization reference and chart gallery for specific chart details.

  • It offers two methods: get(option) to retrieve a specific option's value, returning null if not set, and getOrDefault(option) which returns the option's value or its default if available, otherwise null.

ChartOptions

Exposes options currently configured for a Chart, such as height, color, etc.

Please see the visualization reference documentation for information on what options are available. Specific options for each chart can be found by clicking on the specific chart in the chart gallery.

These options are immutable.

Methods

MethodReturn typeBrief description
get(option)ObjectReturns a configured option for this chart.
getOrDefault(option)ObjectReturns a configured option for this chart.

Detailed documentation

get(option)

Returns a configured option for this chart.

Parameters

NameTypeDescription
optionStringThe string representing the desired option.

Return

Object — The value currently set for the specified option or null if the option was not set.


getOrDefault(option)

Returns a configured option for this chart. If the chart option is not set, returns the default value of this option if available, or returns null if the default value is not available.

Parameters

NameTypeDescription
optionStringThe string representing the desired option.

Return

Object — The value currently set for the specified option. If the option was not set and the default value is available, returns the default value.