Class ChartOptions

  • ChartOptions exposes configurable options for a Chart, such as height and color.

  • Chart options are immutable.

  • Theget(option) method returns a configured option, ornull if not set.

  • ThegetOrDefault(option) method returns a configured option, or its default value if available.

ChartOptions

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

Please see thevisualizationreference documentation for information on what options are available. Specific options foreach chart can be found by clicking on the specific chart in thechart 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 ornull if the option was not set.


getOrDefault(option)

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

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.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.