Class ChartOptions
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Opzionidel grafico
Mostra le opzioni attualmente configurate per un Chart
, ad esempio altezza, colore e così via.
Per informazioni sulle opzioni disponibili, consulta la documentazione di riferimento per le visualizzazioni. Puoi trovare opzioni specifiche per ciascun grafico facendo clic sul grafico specifico nella galleria dei grafici.
Queste opzioni sono immutabili.
Metodi
Metodo | Tipo restituito | Breve descrizione |
get(option) | Object | Restituisce un'opzione configurata per questo grafico. |
getOrDefault(option) | Object | Restituisce un'opzione configurata per questo grafico. |
Documentazione dettagliata
get(option)
Restituisce un'opzione configurata per questo grafico.
Parametri
Nome | Tipo | Descrizione |
option | String | La stringa che rappresenta l'opzione desiderata. |
Invio
Object
: il valore attualmente impostato per l'opzione specificata o null
se l'opzione non è stata impostata.
getOrDefault(option)
Restituisce un'opzione configurata per questo grafico. Se l'opzione del grafico non è impostata, restituisce il valore predefinito di questa opzione, se disponibile, oppure null
se il valore predefinito non è disponibile.
Parametri
Nome | Tipo | Descrizione |
option | String | La stringa che rappresenta l'opzione desiderata. |
Invio
Object
: il valore attualmente impostato per l'opzione specificata. Se l'opzione non è impostata e il valore predefinito è disponibile, restituisce il valore predefinito.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eChartOptions\u003c/code\u003e provides access to the configuration settings of a Chart, such as height and color, and these options cannot be changed once set.\u003c/p\u003e\n"],["\u003cp\u003eTo understand available options, refer to the visualization reference and chart gallery for specific chart details.\u003c/p\u003e\n"],["\u003cp\u003eIt offers two methods: \u003ccode\u003eget(option)\u003c/code\u003e to retrieve a specific option's value, returning \u003ccode\u003enull\u003c/code\u003e if not set, and \u003ccode\u003egetOrDefault(option)\u003c/code\u003e which returns the option's value or its default if available, otherwise \u003ccode\u003enull\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class ChartOptions\n\nChartOptions\n\nExposes options currently configured for a [Chart](/apps-script/reference/charts/chart), such as height, color, etc.\n\nPlease see the [visualization\nreference](https://developers.google.com/chart/interactive/docs/customizing_charts) documentation for information on what options are available. Specific options for\neach chart can be found by clicking on the specific chart in the [chart gallery](https://developers.google.com/chart/interactive/docs/gallery).\n\nThese options are immutable. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------|-------------|---------------------------------------------|\n| [get(option)](#get(String)) | `Object` | Returns a configured option for this chart. |\n| [getOrDefault(option)](#getOrDefault(String)) | `Object` | Returns a configured option for this chart. |\n\nDetailed documentation\n----------------------\n\n### `get(option)`\n\nReturns a configured option for this chart.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|----------|---------------------------------------------|\n| `option` | `String` | The string representing the desired option. |\n\n#### Return\n\n\n`Object` --- The value currently set for the specified option or `null` if the option was not\nset.\n\n*** ** * ** ***\n\n### `get``Or``Default(option)`\n\nReturns a configured option for this chart. If the chart option is not set, returns the default\nvalue of this option if available, or returns `null` if the default value is not\navailable.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|----------|---------------------------------------------|\n| `option` | `String` | The string representing the desired option. |\n\n#### Return\n\n\n`Object` --- The value currently set for the specified option. If the option was not set and the\ndefault value is available, returns the default value."]]