Class ContainerInfo
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
कंटेनरजानकारी
किसी शीट में चार्ट की जगह ऐक्सेस करता है. इसे EmbeddedChart.modify()
फ़ंक्शन का इस्तेमाल करके अपडेट किया जा सकता है.
const sheet = SpreadsheetApp.getActiveSheet();
const chart = sheet.getCharts()[0];
const modifiedChart = chart.modify().setPosition(5, 5, 0, 0).build();
sheet.updateChart(modifiedChart);
तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
getAnchorColumn() | Integer | चार्ट का बायां हिस्सा इस कॉलम में ऐंकर किया गया है. |
getAnchorRow() | Integer | चार्ट का ऊपरी हिस्सा इस लाइन में ऐंकर किया गया है. |
getOffsetX() | Integer | चार्ट का सबसे ऊपर बायां कोना, ऐंकर किए गए कॉलम से इतने पिक्सल की दूरी पर है. |
getOffsetY() | Integer | चार्ट का ऊपरी बायां कोना, ऐंकर की गई लाइन से इतने पिक्सल की दूरी पर है. |
ज़्यादा जानकारी वाला दस्तावेज़
getAnchorColumn()
चार्ट का बायां हिस्सा इस कॉलम में ऐंकर किया गया है.
वापसी का टिकट
Integer
— 1 से इंडेक्स किया गया कॉलम (यानी कि कॉलम C, 3 है).
getAnchorRow()
चार्ट का ऊपरी हिस्सा इस लाइन में ऐंकर किया गया है.
वापसी का टिकट
Integer
— इंडेक्स की गई पंक्ति (यानी कि पांचवीं पंक्ति का इंडेक्स 5 होता है).
getOffsetX()
चार्ट का सबसे ऊपर बायां कोना, ऐंकर किए गए कॉलम से इतने पिक्सल की दूरी पर है.
वापसी का टिकट
Integer
— यह चार्ट के सबसे ऊपर बाएं कोने के लिए, पिक्सल में हॉरिज़ॉन्टल ऑफ़सेट होता है.
getOffsetY()
चार्ट का ऊपरी बायां कोना, ऐंकर की गई लाइन से इतने पिक्सल की दूरी पर है.
वापसी का टिकट
Integer
— यह चार्ट के ऊपर बाएं कोने के लिए, पिक्सल में वर्टिकल ऑफ़सेट होता है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-13 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-13 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eContainerInfo\u003c/code\u003e allows you to access and update an embedded chart's position within a Google Sheet.\u003c/p\u003e\n"],["\u003cp\u003eYou can get the chart's anchor column and row, which determine its main positioning.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eOffsetX\u003c/code\u003e and \u003ccode\u003eOffsetY\u003c/code\u003e properties provide pixel-level control over the chart's placement relative to the anchor point.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003emodify()\u003c/code\u003e and \u003ccode\u003esetPosition()\u003c/code\u003e functions along with \u003ccode\u003eupdateChart()\u003c/code\u003e to change the chart's position programmatically.\u003c/p\u003e\n"]]],[],null,["# Class ContainerInfo\n\nContainerInfo\n\nAccess the chart's position within a sheet. Can be updated using the [EmbeddedChart.modify()](/apps-script/reference/spreadsheet/embedded-chart#modify()) function.\n\n```javascript\nconst sheet = SpreadsheetApp.getActiveSheet();\nconst chart = sheet.getCharts()[0];\nconst modifiedChart = chart.modify().setPosition(5, 5, 0, 0).build();\nsheet.updateChart(modifiedChart);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------|-------------|------------------------------------------------------------------------------------------|\n| [getAnchorColumn()](#getAnchorColumn()) | `Integer` | The chart's left side is anchored in this column. |\n| [getAnchorRow()](#getAnchorRow()) | `Integer` | The chart's top side is anchored in this row. |\n| [getOffsetX()](#getOffsetX()) | `Integer` | The chart's upper left hand corner is offset from the anchor column by this many pixels. |\n| [getOffsetY()](#getOffsetY()) | `Integer` | The chart's upper left hand corner is offset from the anchor row by this many pixels. |\n\nDetailed documentation\n----------------------\n\n### `get``Anchor``Column()`\n\nThe chart's left side is anchored in this column.\n\n#### Return\n\n\n`Integer` --- 1-indexed column (that is, column C is 3).\n\n*** ** * ** ***\n\n### `get``Anchor``Row()`\n\nThe chart's top side is anchored in this row.\n\n#### Return\n\n\n`Integer` --- 1-indexed row (that is, row 5 returns 5).\n\n*** ** * ** ***\n\n### `get``Offset``X()`\n\nThe chart's upper left hand corner is offset from the anchor column by this many pixels.\n\n#### Return\n\n\n`Integer` --- The horizontal offset in pixels for the upper left hand corner of the chart.\n\n*** ** * ** ***\n\n### `get``Offset``Y()`\n\nThe chart's upper left hand corner is offset from the anchor row by this many pixels.\n\n#### Return\n\n\n`Integer` --- The vertical offset in pixels for the upper left hand corner of the chart."]]