ui.Chart.onClick
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह कुकी, एक कॉलबैक रजिस्टर करती है. जब चार्ट पर क्लिक किया जाता है, तब यह कॉलबैक ट्रिगर होता है.
यह एक ऐसा आईडी दिखाता है जिसे unlisten() को पास किया जा सकता है, ताकि कॉलबैक को अनरजिस्टर किया जा सके.
इस्तेमाल | रिटर्न |
---|
Chart.onClick(callback) | स्ट्रिंग |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: ui.chart | ui.Chart | ui.Chart इंस्टेंस. |
callback | फ़ंक्शन | चार्ट पर क्लिक करने पर, इस कॉलबैक को ट्रिगर किया जाता है. कॉल बैक में तीन आर्ग्युमेंट पास किए जाते हैं: x-वैल्यू, y-वैल्यू, और सीरीज़ का नाम. समय की वैल्यू को यूटीसी ईपॉक मिलीसेकंड में दिखाया जाता है. जैसे, ऐसेट पर "system:time_start" वैल्यू. अगर उपयोगकर्ता पूरी सीरीज़ चुनने के लिए, लेजेंड एंट्री पर क्लिक करता है, तो x और y की वैल्यू शून्य होती हैं. अगर उपयोगकर्ता पहले से चुने गए किसी पॉइंट पर क्लिक करता है, तो सभी तर्क शून्य हो जाते हैं. इससे पता चलता है कि चुनाव हटा दिया गया है. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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. |"]]