Class ChartOptions
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אפשרויות של התרשים
חושף את האפשרויות שמוגדרות כרגע ל-Chart
, כמו גובה, צבע וכו'.
מידע על האפשרויות הזמינות זמין במסמכי העזרה בנושא תצוגה חזותית. אפשרויות ספציפיות לכל תרשים מופיעות בלחיצה על התרשים הספציפי בגלריית התרשימים.
האפשרויות האלה לא ניתנות לשינוי.
Methods
שיטה | סוג הערך המוחזר | תיאור קצר |
get(option) | Object | הפונקציה מחזירה אפשרות מוגדרת לתרשים הזה. |
getOrDefault(option) | Object | הפונקציה מחזירה אפשרות מוגדרת לתרשים הזה. |
מסמכים מפורטים
get(option)
הפונקציה מחזירה אפשרות מוגדרת לתרשים הזה.
פרמטרים
שם | סוג | תיאור |
option | String | המחרוזת שמייצגת את האפשרות הרצויה. |
חזרה
Object
– הערך שמוגדר כרגע לאפשרות שצוינה, או null
אם האפשרות לא הוגדרה.
getOrDefault(option)
הפונקציה מחזירה אפשרות מוגדרת לתרשים הזה. אם אפשרות התרשים לא מוגדרת, הפונקציה מחזירה את ערך ברירת המחדל של האפשרות הזו, אם הוא זמין, או מחזירה את הערך null
אם ערך ברירת המחדל לא זמין.
פרמטרים
שם | סוג | תיאור |
option | String | המחרוזת שמייצגת את האפשרות הרצויה. |
חזרה
Object
– הערך שמוגדר כרגע לאפשרות שצוינה. אם האפשרות לא הוגדרה וערך ברירת המחדל זמין, הפונקציה מחזירה את ערך ברירת המחדל.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 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."]]