Class ChartOptions Stay organized with collections Save and categorize content based on your preferences.
Page Summary
ChartOptions exposes configurable options for a Chart, such as height and color.
Chart options are immutable.
The
get(option)method returns a configured option, ornullif not set.The
getOrDefault(option)method returns a configured option, or its default value if available.
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
| Method | Return type | Brief description |
|---|---|---|
get(option) | Object | Returns a configured option for this chart. |
get | Object | Returns a configured option for this chart. |
Detailed documentation
get(option)
Returns a configured option for this chart.
Parameters
| Name | Type | Description |
|---|---|---|
option | String | The 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
| Name | Type | Description |
|---|---|---|
option | String | The 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.