公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Chart.setSeriesNames
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
返回此图表的副本,其中包含更新后的序列名称。
用法 | 返回 |
---|
Chart.setSeriesNames(seriesNames, seriesIndex) | ui.Chart |
参数 | 类型 | 详细信息 |
---|
此:ui.chart | ui.Chart | ui.Chart 实例。 |
seriesNames | 字典|Dictionary<String>|列表|List<String>|字符串 | 新系列名称。如果为字符串,则将 seriesIndex 处的系列名称设置为 seriesNames。如果它是列表,则列表中的索引 i 处的值将用作序列号 i 的标签。如果是字典或对象,则将其视为从现有序列名称到新序列名称的映射。在后两种情况下,系统会忽略 seriesIndex。 |
seriesIndex | 数字,可选 | 要重命名的序列的索引。如果 seriesNames 是列表或字典,则忽略此参数。系列从 0 开始编制索引。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):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. |"]]