Class ChartOptions
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวเลือกแผนภูมิ
แสดงตัวเลือกที่กําหนดค่าไว้สําหรับ Chart
ในปัจจุบัน เช่น ความสูง สี ฯลฯ
โปรดดูข้อมูลเกี่ยวกับตัวเลือกที่มีอยู่ในเอกสารข้อมูลอ้างอิงของการแสดงภาพ คุณดูตัวเลือกเฉพาะสำหรับแต่ละแผนภูมิได้โดยคลิกที่แผนภูมิที่ต้องการในแกลเลอรีแผนภูมิ
ตัวเลือกเหล่านี้จะเปลี่ยนแปลงไม่ได้
เมธอด
วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
get(option) | Object | แสดงผลตัวเลือกที่กําหนดค่าไว้สําหรับแผนภูมินี้ |
getOrDefault(option) | Object | แสดงผลตัวเลือกที่กําหนดค่าไว้สําหรับแผนภูมินี้ |
เอกสารประกอบโดยละเอียด
get(option)
แสดงผลตัวเลือกที่กําหนดค่าไว้สําหรับแผนภูมินี้
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
option | String | สตริงที่แสดงถึงตัวเลือกที่ต้องการ |
รีเทิร์น
Object
— ค่าที่กําหนดไว้สําหรับตัวเลือกที่ระบุในปัจจุบัน หรือ null
หากไม่ได้ตั้งค่าตัวเลือก
getOrDefault(option)
แสดงผลตัวเลือกที่กําหนดค่าไว้สําหรับแผนภูมินี้ หากไม่ได้ตั้งค่าตัวเลือกแผนภูมิ ระบบจะแสดงค่าเริ่มต้นของตัวเลือกนี้ (หากมี) หรือแสดง null
หากไม่มีค่าเริ่มต้น
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
option | String | สตริงที่แสดงถึงตัวเลือกที่ต้องการ |
รีเทิร์น
Object
— ค่าที่กําหนดไว้สําหรับตัวเลือกที่ระบุในปัจจุบัน หากไม่ได้ตั้งค่าตัวเลือกไว้และค่าเริ่มต้นพร้อมใช้งาน ระบบจะแสดงผลค่าเริ่มต้น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 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."]]