التصور: مخطط خطي (صورة)
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ملاحظة مهمة: لقد تم إيقاف جزء "مخططات الصور" في "أدوات مخططات Google" رسميًا اعتبارًا من 20 نيسان (أبريل) 2012. وسيبقى بإمكانك استخدامه وفقًا لسياسة الإيقاف المتّبعة لدينا.
نظرة عامة
رسم بياني خطي يتم عرضه كصورة باستخدام Google Charts API
مثال
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["imagelinechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var chart = new google.visualization.ImageLineChart(document.getElementById('chart_div'));
chart.draw(data, {width: 400, height: 240, min: 0});
}
</script>
</head>
<body>
<div id="chart_div" style="width: 400px; height: 240px;"></div>
</body>
</html>
جارٍ التحميل
اسم حزمة "google.charts.load
" هو "imagelinechart"
.
google.charts.load('current', {packages: ['imagelinechart']});
اسم فئة العرض المرئي هو google.visualization.ImageLineChart
.
var visualization = new google.visualization.ImageLineChart(container);
يجب أن يكون العمود الأول سلسلة، وأن يحتوي على تسمية الفئة.
يمكن أن يتبع هذا العدد أي عدد من الأعمدة، ولكن يجب أن تكون جميعها رقمية.
يتم عرض كل عمود كخط منفصل.
خيارات الضبط
الاسم |
النوع |
القيمة التلقائية |
الوصف |
backgroundColor |
سلسلة |
'#FFFFFF' (أبيض) |
لون خلفية الرسم البياني في تنسيق ألوان Chart API |
الألوان |
مصفوفة<string> |
تلقائية |
استخدِم هذا الخيار لتحديد ألوان معيّنة لكل سلسلة بيانات. ويتم تحديد الألوان في تنسيق ألوان Chart API.
يُستخدم اللون i في عمود البيانات i، والذي يلتف حول البداية
إذا كان هناك أعمدة بيانات أكثر من الألوان. إذا كانت صيغ اللون الواحد مقبولة لكل السلاسل، استخدِم الخيار color
بدلاً من ذلك. |
enableEvents |
boolean |
false |
يؤدي إلى طرح الرسوم البيانية للأحداث التي يشغّلها المستخدم، مثل النقر أو الماوس.
لا تتوفّر هذه الميزة إلا لأنواع محددة من الرسوم البيانية. يمكنك الاطّلاع على الأحداث أدناه. |
الطول |
الرقم |
ارتفاع الحاوية |
ارتفاع الرسم البياني بالبكسل |
أسطورة |
سلسلة |
"يمين" |
موضع ونوع وسيلة الإيضاح. يمكن أن تكون الحالة إحدى القيم التالية:
- "right" - إلى يمين المخطط.
- "يسار" - إلى يسار الرسم البياني
- "أعلى" - أعلى الرسم البياني
- "أسفل" - أسفل الرسم البياني.
- 'none' - لا يتم عرض أي وسيلة إيضاح.
|
الحد الأقصى |
الرقم |
تلقائية |
الحد الأقصى للقيمة المراد عرضها في المحور "ص" |
دقيقة |
الرقم |
تلقائية |
أدنى قيمة يمكن عرضها في المحور ص. |
showAxisLines |
boolean |
صحيح |
في حال ضبط هذه السياسة على "خطأ"، ستتم إزالة خطوط المحور والتصنيفات. |
showCategoryLabels |
boolean |
مثل showAxisLines |
في حال الضبط على "خطأ"، ستتم إزالة تسميات الفئات (تصنيفات المحور س).
|
showValueLabels |
boolean |
مثل showAxisLines |
إذا تم التعيين على "false"، فستتم إزالة تسميات القيم (تصنيفات المحور ص). |
title |
سلسلة |
بلا عنوان |
النص المطلوب عرضه أعلى الرسم البياني |
valueLabelsInterval |
الرقم |
تلقائية |
الفاصل الزمني الذي يتم خلاله إظهار تصنيفات محور القيمة. على سبيل المثال، إذا كانت قيمة السمة min
هي 0 والقيمة max هي 100 والقيمة valueLabelsInterval
هي 20، سيعرض الرسم البياني تصنيفات المحاور على القيم التالية: (0 و20 و40 و60 و80 100). |
العرض |
الرقم |
عرض الحاوية |
عرض الرسم البياني بالبكسل. |
الطُرق
الطريقة |
نوع القيمة التي يتم عرضها |
الوصف |
draw(data, options) |
لا ينطبق |
لرسم الرسم البياني. |
الأحداث
يمكنك التسجيل للاستماع إلى الفعاليات الموضّحة في صفحة الرسم البياني
العام للصور.
سياسة البيانات
يُرجى الرجوع إلى سياسة التسجيل في Chart API.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-07-10 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-07-10 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Visualization: Line Chart (Image)\n\n**Important:** The Image Charts portion of Google Chart Tools has been [officially deprecated](http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html) as of April 20, 2012. It will continue to work as per our [deprecation policy](/chart/terms). \n1. [Overview](#Overview)\n2. [Example](#Example)\n3. [Loading](#Loading)\n4. [Data Format](#Data_Format)\n5. [Configuration Options](#Configuration_Options)\n6. [Methods](#Methods)\n7. [Events](#Events)\n8. [Data Policy](#Data_Policy)\n\nOverview\n--------\n\n\nA line chart that is rendered as an image using the [Google Charts API](/chart/image/docs/gallery/line_charts).\n\nExample\n-------\n\n\\\u003cscript type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"\\\u003e\\\u003c/script\\\u003e \\\u003cscript type=\"text/javascript\"\\\u003e google.charts.load('current', {'packages':\\['imagelinechart'\\]}); \\\u003c/script\\\u003e \\\u003cdiv id=\"chart_div\" style=\"width: 400px; height: 240px;\"\\\u003e\\\u003c/div\\\u003e google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable(\\[ \\['Year', 'Sales', 'Expenses'\\], \\['2004', 1000, 400\\], \\['2005', 1170, 460\\], \\['2006', 660, 1120\\], \\['2007', 1030, 540\\] \\]); var chart = new google.visualization.ImageLineChart(document.getElementById('chart_div')); chart.draw(data, {width: 400, height: 240, min: 0}); } \n\n```html\n\u003chtml\u003e\n \u003chead\u003e\n \u003cscript type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"\u003e\u003c/script\u003e\n \u003cscript type=\"text/javascript\"\u003e\n google.charts.load(\"current\", {packages:[\"imagelinechart\"]});\n google.charts.setOnLoadCallback(drawChart);\n\n function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Year', 'Sales', 'Expenses'],\n ['2004', 1000, 400],\n ['2005', 1170, 460],\n ['2006', 660, 1120],\n ['2007', 1030, 540]\n ]);\n\n var chart = new google.visualization.ImageLineChart(document.getElementById('chart_div'));\n\n chart.draw(data, {width: 400, height: 240, min: 0});\n }\n \u003c/script\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv id=\"chart_div\" style=\"width: 400px; height: 240px;\"\u003e\u003c/div\u003e\n \u003c/body\u003e\n\u003c/html\u003e\n```\n\nLoading\n-------\n\n\nThe `google.charts.load` package name is `\"imagelinechart\"`. \n\n```gdscript\n google.charts.load('current', {packages: ['imagelinechart']});\n```\n\n\nThe visualization's class name is `google.visualization.ImageLineChart`. \n\n```gdscript\n var visualization = new google.visualization.ImageLineChart(container);\n```\n\nData Format\n-----------\n\n\nThe first column should be a string, and contain the category label.\nAny number of columns can follow, all must be numeric.\nEach column is displayed as a separate line.\n\nConfiguration Options\n---------------------\n\n| Name | Type | Default | Description |\n|---------------------|-----------------|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| backgroundColor | string | '#FFFFFF' (white) | The background color for the chart in the [Chart API color format](/chart/image/docs/chart_params#gcharts_rgb). |\n| colors | Array\\\u003cstring\\\u003e | Auto | Use this to assign specific colors to each data series. Colors are specified in the [Chart API color format](/chart/image/docs/chart_params#gcharts_rgb). Color i is used for data column i, wrapping around to the beginning if there are more data columns than colors. If variations of a single color is acceptable for all series, use the `color` option instead. |\n| enableEvents | boolean | false | Causes charts to throw user-triggered events such as click or mouse over. Supported only for specific chart types. See [Events](#Events) below. |\n| height | number | Container's height | Height of the chart in pixels. |\n| legend | string | 'right' | Position and type of legend. Can be one of the following: - 'right' - To the right of the chart. - 'left' - To the left of the chart. - 'top' - Above the chart. - 'bottom' - Below the chart. - 'none' - No legend is displayed. |\n| max | number | automatic | The maximal value to show in the Y axis. |\n| min | number | automatic | The minimal value to show in the Y axis. |\n| showAxisLines | boolean | true | If set to false, removes axis lines and labels. |\n| showCategoryLabels | boolean | same as showAxisLines | If set to false, removes the labels of the categories (the X axis labels). |\n| showValueLabels | boolean | same as showAxisLines | If set to false, removes the labels of the values (the Y axis labels). |\n| title | string | no title | Text to display above the chart. |\n| valueLabelsInterval | number | Auto | The interval at which to show value axis labels. For example, if `min` is 0, `max` is 100, and `valueLabelsInterval` is 20, the chart will show axis labels at (0, 20, 40, 60, 80 100). |\n| width | number | Container's width | Width of the chart in pixels. |\n\nMethods\n-------\n\n| Method | Return Type | Description |\n|-----------------------|-------------|------------------|\n| `draw(data, options)` | none | Draws the chart. |\n\nEvents\n------\n\nYou can register to hear the events described on the [Generic\nImage Chart](/chart/interactive/docs/gallery/genericimagechart#Events) page.\n\nData Policy\n-----------\n\n\nPlease refer to the [Chart API logging policy](/chart/interactive/faq#logging)."]]