ui.Chart.setSeriesNames
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trả về bản sao của biểu đồ này với tên chuỗi được cập nhật.
Cách sử dụng | Giá trị trả về |
---|
Chart.setSeriesNames(seriesNames, seriesIndex) | ui.Chart |
Đối số | Loại | Thông tin chi tiết |
---|
this: ui.chart | ui.Chart | Thực thể ui.Chart. |
seriesNames | Dictionary|Dictionary<String>|List|List<String>|String | Tên bộ phim mới. Nếu đó là một chuỗi, tên của bộ tại seriesIndex sẽ được đặt thành seriesNames. Nếu đó là một danh sách, thì giá trị tại chỉ mục i trong danh sách sẽ được dùng làm nhãn cho số sê-ri i. Nếu là một từ điển hoặc một đối tượng, thì nó được coi là một bản đồ từ tên bộ truyện hiện có sang tên bộ truyện mới. Trong hai trường hợp cuối, seriesIndex sẽ bị bỏ qua. |
seriesIndex | Số, không bắt buộc | Chỉ mục của chuỗi cần đổi tên. Bị bỏ qua nếu seriesNames là một danh sách hoặc từ điển. Chuỗi được lập chỉ mục từ 0. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\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. |"]]