公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ui.Chart.setSeriesNames
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回更新序列名稱的圖表副本。
用量 | 傳回 |
---|
Chart.setSeriesNames(seriesNames, seriesIndex) | ui.Chart |
引數 | 類型 | 詳細資料 |
---|
這個:ui.chart | ui.Chart | ui.Chart 執行個體。 |
seriesNames | Dictionary|Dictionary<String>|List|List<String>|String | 新系列名稱。如果是字串,則 seriesIndex 的系列名稱會設為 seriesNames。如果是清單,清單中索引 i 的值會做為序列編號 i 的標籤。如果是字典或物件,系統會將其視為從現有影集名稱到新影集名稱的對應。在最後兩種情況下,系統會忽略 seriesIndex。 |
seriesIndex | 號碼 (選填) | 要重新命名的序列索引。如果 seriesNames 是清單或字典,系統會忽略這項設定。系列從 0 開始編號。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eThe \u003ccode\u003eChart.setSeriesNames\u003c/code\u003e function updates the names of series within a chart.\u003c/p\u003e\n"],["\u003cp\u003eYou can update series names using a single string, a list of names, or a dictionary mapping old names to new ones.\u003c/p\u003e\n"],["\u003cp\u003eWhen using a string or list, an optional \u003ccode\u003eseriesIndex\u003c/code\u003e argument specifies the target series (0-based indexing).\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a modified copy of the chart with the updated series names, leaving the original chart unchanged.\u003c/p\u003e\n"]]],["The `Chart.setSeriesNames` function updates series names within a chart. It accepts `seriesNames` as either a string, list, or dictionary. A string renames a specific series by `seriesIndex`. A list sets series names based on their index. A dictionary maps existing series names to new ones. The function returns a new chart (`ui.Chart`) with the updated series names, leaving the original chart untouched. The `seriesIndex` argument is used only when a single string is passed to `seriesNames`.\n"],null,["# ui.Chart.setSeriesNames\n\n\u003cbr /\u003e\n\nReturns a copy of this chart with updated series names.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------|----------|\n| Chart.setSeriesNames`(seriesNames, `*seriesIndex*`)` | ui.Chart |\n\n| Argument | Type | Details |\n|------------------|----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.chart` | ui.Chart | The ui.Chart instance. |\n| `seriesNames` | Dictionary\\|Dictionary\\\u003cString\\\u003e\\|List\\|List\\\u003cString\\\u003e\\|String | New series names. If it's a string, the name of the series at seriesIndex is set to seriesNames. If it's a list, the value at index i in the list is used as a label for series number i. If it's a dictionary or an object, it's treated as a map from existing series names to new series names. In the last two cases, seriesIndex is ignored. |\n| `seriesIndex` | Number, optional | The index of the series to rename. Ignored if seriesNames is a list or dictionary. Series are 0-indexed. |"]]