お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ui.Chart.onClick
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
グラフがクリックされたときに起動されるコールバックを登録します。
コールバックの登録を解除するために unlisten() に渡すことができる ID を返します。
用途 | 戻り値 |
---|
Chart.onClick(callback) | 文字列 |
引数 | タイプ | 詳細 |
---|
これ: ui.chart | ui.Chart | ui.Chart インスタンス。 |
callback | 関数 | グラフがクリックされたときに呼び出されるコールバック。コールバックには、x 値、y 値、シリーズ名の 3 つの引数が渡されます。時刻値は、アセットの「system:time_start」値のように、UTC エポック ミリ秒で表されます。ユーザーが凡例のエントリをクリックして系列全体を選択すると、x 値と y 値は null になります。ユーザーがすでに選択されているポイントをクリックすると、すべての引数が null になり、選択がクリアされたことを示します。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-29 UTC。
[null,null,["最終更新日 2025-07-29 UTC。"],[[["\u003cp\u003eThe \u003ccode\u003eChart.onClick()\u003c/code\u003e method registers a callback function that is triggered when a user clicks on a chart.\u003c/p\u003e\n"],["\u003cp\u003eThis function returns a unique ID that can be used with \u003ccode\u003eunlisten()\u003c/code\u003e to remove the registered callback.\u003c/p\u003e\n"],["\u003cp\u003eThe callback function receives the x-value, y-value, and series name as arguments, providing information about the clicked point on the chart.\u003c/p\u003e\n"],["\u003cp\u003eClicking on a legend entry to select a series results in null x and y values, while clicking an already-selected point results in all null arguments indicating selection clearance.\u003c/p\u003e\n"]]],[],null,["# ui.Chart.onClick\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired when the chart is clicked.\n\n\u003cbr /\u003e\n\nReturns an ID which can be passed to unlisten() to unregister the callback.\n\n| Usage | Returns |\n|---------------------------|---------|\n| Chart.onClick`(callback)` | String |\n\n| Argument | Type | Details |\n|------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.chart` | ui.Chart | The ui.Chart instance. |\n| `callback` | Function | The callback to fire when the chart is clicked. The callback is passed three arguments: the x-value, the y-value, and the series name. Time values are represented in UTC epoch milliseconds, like \"system:time_start\" values on assets. If the user clicks on a legend entry to select an entire series, the x- and y-values are null. If the user clicks an already-selected point, all arguments are null, indicating the selection was cleared. |"]]