विज़ुअलाइज़ेशन: लाइन चार्ट (इमेज)
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
अहम जानकारी: 20 अप्रैल, 2012 से Google चार्ट टूल के 'इमेज चार्ट' वाले हिस्से को आधिकारिक तौर पर बंद कर दिया गया है. यह खाता, सुविधा बंद करने की हमारी नीति के हिसाब से काम करता रहेगा.
खास जानकारी
ऐसा लाइन चार्ट जिसे 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' (सफ़ेद) |
चार्ट एपीआई कलर फ़ॉर्मैट में चार्ट के बैकग्राउंड का रंग. |
कलर |
कलेक्शन<string> |
ऑटो |
हर डेटा सीरीज़ को खास रंग असाइन करने के लिए इसका इस्तेमाल करें. कलर,
चार्ट एपीआई कलर फ़ॉर्मैट में बताए जाते हैं.
अगर कलर से ज़्यादा डेटा कॉलम हैं, तो कलर i का इस्तेमाल डेटा कॉलम i के लिए किया जाता है. यह शुरुआत तक रैप करता है. अगर एक ही रंग के वैरिएशन सभी सीरीज़ के लिए सही हैं, तो color विकल्प
का इस्तेमाल करें. |
enableEvents |
boolean |
false |
इसकी वजह से, उपयोगकर्ता से ट्रिगर होने वाले इवेंट, जैसे कि क्लिक या माउस ओवर फेंकते हैं.
इसका इस्तेमाल सिर्फ़ चुनिंदा चार्ट टाइप के लिए किया जा सकता है. नीचे इवेंट देखें. |
ऊंचाई |
नंबर |
कंटेनर की ऊंचाई |
पिक्सल में चार्ट की ऊंचाई. |
लेजेंड |
स्ट्रिंग |
'राइट' |
लेजेंड की जगह और टाइप. इनमें से कोई एक स्थिति हो सकती है:
- 'दाईं ओर' - चार्ट की दाईं ओर.
- 'बायां' - चार्ट के बाईं ओर.
- 'सबसे ऊपर' - चार्ट के ऊपर.
- 'सबसे नीचे' - चार्ट के नीचे.
- 'कोई भी नहीं' - कोई लेजेंड नहीं दिखाया गया.
|
ज़्यादा से ज़्यादा |
नंबर |
स्वचालित |
Y ऐक्सिस में दिखाई जाने वाली सबसे बड़ी वैल्यू. |
कम से कम |
नंबर |
स्वचालित |
Y ऐक्सिस में दिखाने के लिए कम से कम वैल्यू. |
showAxisLines |
boolean |
सही |
अगर नीति को 'गलत है' पर सेट किया जाता है, तो ऐक्सिस लाइन और लेबल हटा दिए जाते हैं. |
showCategoryLabels |
boolean |
ShowAxisLines की तरह |
अगर नीति को 'गलत है' पर सेट किया जाता है, तो कैटगरी के लेबल (X ऐक्सिस लेबल) हटा दिए जाते हैं.
|
showValueLabels |
boolean |
ShowAxisLines की तरह |
अगर नीति को 'गलत है' पर सेट किया जाता है, तो वैल्यू के लेबल (Y ऐक्सिस लेबल) हटा दिए जाते हैं. |
title |
स्ट्रिंग |
कोई टाइटल नहीं |
चार्ट के ऊपर दिखाया जाने वाला टेक्स्ट. |
valueLabelsInterval |
नंबर |
ऑटो |
वह इंटरवल जिस पर वैल्यू ऐक्सिस लेबल दिखाना है. उदाहरण के लिए, अगर min
0, max , 100, और valueLabelsInterval
20 है, तो चार्ट में ऐक्सिस लेबल (0, 20, 40, 60, 80 100) दिखेंगे. |
चौड़ाई |
नंबर |
कंटेनर की चौड़ाई |
पिक्सल में चार्ट की चौड़ाई. |
तरीके
तरीका |
रिटर्न टाइप |
ब्यौरा |
draw(data, options) |
कुछ नहीं |
चार्ट बनाता है. |
इवेंट
जेनरिक इमेज चार्ट पेज पर बताए गए इवेंट सुनने के लिए रजिस्टर किया जा सकता है.
डेटा नीति
कृपया Chart API को लॉग करने की नीति देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-07-10 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-07-10 (UTC) को अपडेट किया गया."],[],[],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)."]]