Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Interface DataTableSource
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
DataTableSource
واجهة للعناصر التي يمكنها تمثيل بياناتها كـ DataTable.
تنفيذ الفئات
| الاسم | وصف قصير |
DataTable | جدول بيانات سيتم استخدامه في الرسوم البيانية |
Range | الوصول إلى نطاقات جداول البيانات وتعديلها |
الطُرق
| الطريقة | نوع القيمة التي تم إرجاعها | وصف قصير |
getDataTable() | DataTable | تعرض هذه الدالة البيانات داخل هذا العنصر كـ DataTable. |
مستندات تفصيلية
getDataTable()
تعرض هذه الدالة البيانات داخل هذا العنصر كـ DataTable.
// Opens the spreadsheet file by its ID. If you created your script from a
// Google Sheets file, use SpreadsheetApp.getActiveSpreadsheet().
// TODO(developer): Replace the ID with your own.
const ss = SpreadsheetApp.openById('abc123456');
// Gets Sheet1 by its name.
const sheet = ss.getSheetByName('Sheet1');
// Gets the range A1:B7 on Sheet1.
const range = sheet.getRange('A1:B7');
// Gets the range A1:B7 as a data table. The values in each column must be of
// the same type.
const datatable = range.getDataTable();
// Uses the Charts service to build a bar chart from the data table.
// This doesn't build an embedded chart. To do that, use
// sheet.newChart().addRange() instead.
const chart = Charts.newBarChart()
.setDataTable(datatable)
.setOption('title', 'Your Chart Title Here')
.build();
الإرجاع
DataTable: البيانات كجدول بيانات
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2026-04-13 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2026-04-13 (حسب التوقيت العالمي المتفَّق عليه)"],[],["The `DataTableSource` interface allows objects to represent data as a `DataTable`. It includes the `getDataTable()` method, which returns the object's data in `DataTable` format. Classes like `DataTable` and `Range` implement this interface. The provided example demonstrates retrieving a `Range` from a spreadsheet, converting it to a `DataTable` using `getDataTable()`, and then utilizing this data to construct a bar chart with the Charts service.\n"]]