بررسی اجمالی
نمودارهای پراکنده نقاط را روی یک نمودار رسم می کنند. هنگامی که کاربر روی نقاط میچرخد، راهنمای ابزار با اطلاعات بیشتر نمایش داده میشود.
نمودارهای پراکنده گوگل بسته به قابلیت های مرورگر با استفاده از SVG یا VML در مرورگر ارائه می شوند.
مثال
<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Age', 'Weight'], [ 8, 12], [ 4, 5.5], [ 11, 14], [ 4, 5], [ 3, 3.5], [ 6.5, 7] ]); var options = { title: 'Age vs. Weight comparison', hAxis: {title: 'Age', minValue: 0, maxValue: 15}, vAxis: {title: 'Weight', minValue: 0, maxValue: 15}, legend: 'none' }; var chart = new google.visualization.ScatterChart(document.getElementById('chart_div')); chart.draw(data, options); } </script> </head> <body> <div id="chart_div" style="width: 900px; height: 500px;"></div> </body> </html>
تغییر و متحرک سازی اشکال
به طور پیش فرض، نمودارهای پراکنده عناصر مجموعه داده شما را با دایره نشان می دهند. می توانید اشکال دیگری را با گزینه pointShape
که در مستندات Customizing Points توضیح داده شده است، مشخص کنید.
مانند اکثر نمودارهای Google دیگر، میتوانید با استفاده از رویدادها آنها را متحرک کنید. می توانید برای اولین رویداد ready
شنونده رویداد اضافه کنید و پس از انجام تغییرات مورد نظر نمودار را دوباره ترسیم کنید. پس از اولین رویداد ready
، می توانید به رویداد animationfinish
گوش دهید تا روند تکرار شود و در نتیجه یک انیمیشن پیوسته ایجاد شود. گزینه animation
نحوه انجام دوباره ترسیم را کنترل می کند: بلافاصله (بدون انیمیشن) یا به آرامی، و اگر هموار باشد با چه سرعتی و با چه رفتاری.
var options = { legend: 'none', colors: ['#087037'], pointShape: 'star', pointSize: 18, animation: { duration: 200, easing: 'inAndOut', } }; // Start the animation by listening to the first 'ready' event. google.visualization.events.addOneTimeListener(chart, 'ready', randomWalk); // Control all other animations by listening to the 'animationfinish' event. google.visualization.events.addListener(chart, 'animationfinish', randomWalk); ... function randomWalk() { ... }
<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load("current", {packages:["corechart"]}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('number'); data.addColumn('number'); var radius = 100; for (var i = 0; i < 6.28; i += 0.1) { data.addRow([radius * Math.cos(i), radius * Math.sin(i)]); } // Our central point, which will jiggle. data.addRow([0, 0]); var options = { legend: 'none', colors: ['#087037'], pointShape: 'star', pointSize: 18, animation: { duration: 200, easing: 'inAndOut', } }; var chart = new google.visualization.ScatterChart(document.getElementById('animatedshapes_div')); // Start the animation by listening to the first 'ready' event. google.visualization.events.addOneTimeListener(chart, 'ready', randomWalk); // Control all other animations by listening to the 'animationfinish' event. google.visualization.events.addListener(chart, 'animationfinish', randomWalk); chart.draw(data, options); function randomWalk() { var x = data.getValue(data.getNumberOfRows() - 1, 0); var y = data.getValue(data.getNumberOfRows() - 1, 1); x += 5 * (Math.random() - 0.5); y += 5 * (Math.random() - 0.5); if (x * x + y * y > radius * radius) { // Out of bounds. Bump toward center. x += Math.random() * ((x < 0) ? 5 : -5); y += Math.random() * ((y < 0) ? 5 : -5); } data.setValue(data.getNumberOfRows() - 1, 0, x); data.setValue(data.getNumberOfRows() - 1, 1, y); chart.draw(data, options); } } </script> </head> <body> <div id="animatedshapes_div" style="width: 500px; height: 500px;"></div> </body> </html>
ایجاد نمودارهای پراکندگی مواد
در سال 2014، گوگل دستورالعملهایی را برای پشتیبانی از ظاهر و احساس مشترک در ویژگیها و برنامههای خود (مانند برنامههای اندروید) که بر روی پلتفرمهای Google اجرا میشوند، اعلام کرد. ما این تلاش را طراحی مواد می نامیم. ما نسخههای "ماده" تمام نمودارهای اصلی خود را ارائه خواهیم کرد. اگر از ظاهر آنها خوشتان می آید، می توانید از آنها استفاده کنید.
ایجاد نمودار پراکندگی مواد شبیه به ایجاد چیزی است که اکنون آن را نمودار پراکندگی «کلاسیک» می نامیم. شما Google Visualization API را بارگیری میکنید (اگرچه با بسته 'scatter'
به جای بسته 'corechart'
)، جدول دادهتان را تعریف میکنید و سپس یک شی ایجاد میکنید (اما از کلاس google.charts.Scatter
به جای google.visualization.ScatterChart
).
توجه: نمودارهای مواد در نسخه های قدیمی اینترنت اکسپلورر کار نمی کنند. (IE8 و نسخههای قبلی از SVG پشتیبانی نمیکنند، که نمودارهای مواد به آن نیاز دارند.)
نمودارهای پراکندگی مواد نسبت به نمودارهای پراکنده کلاسیک پیشرفتهای کوچکی دارند، از جمله تیرگی متغیر برای خوانایی نقاط همپوشانی، پالت رنگی بهبود یافته، قالببندی برچسب واضحتر، فاصله پیشفرض دقیقتر، خطوط شبکه و عناوین نرمتر (و اضافه کردن زیرنویسها).
google.charts.load('current', {'packages':['scatter']}); google.charts.setOnLoadCallback(drawChart); function drawChart () { var data = new google.visualization.DataTable(); data.addColumn('number', 'Hours Studied'); data.addColumn('number', 'Final'); data.addRows([ [0, 67], [1, 88], [2, 77], [3, 93], [4, 85], [5, 91], [6, 71], [7, 78], [8, 93], [9, 80], [10, 82],[0, 75], [5, 80], [3, 90], [1, 72], [5, 75], [6, 68], [7, 98], [3, 82], [9, 94], [2, 79], [2, 95], [2, 86], [3, 67], [4, 60], [2, 80], [6, 92], [2, 81], [8, 79], [9, 83], [3, 75], [1, 80], [3, 71], [3, 89], [4, 92], [5, 85], [6, 92], [7, 78], [6, 95], [3, 81], [0, 64], [4, 85], [2, 83], [3, 96], [4, 77], [5, 89], [4, 89], [7, 84], [4, 92], [9, 98] ]); var options = { width: 800, height: 500, chart: { title: 'Students\' Final Grades', subtitle: 'based on hours studied' }, hAxis: {title: 'Hours Studied'}, vAxis: {title: 'Grade'} }; var chart = new google.charts.Scatter(document.getElementById('scatterchart_material')); chart.draw(data, google.charts.Scatter.convertOptions(options)); }
نمودارهای مواد در بتا هستند. ظاهر و تعامل تا حد زیادی نهایی است، اما بسیاری از گزینه های موجود در نمودارهای کلاسیک هنوز در آنها موجود نیستند. شما می توانید لیستی از گزینه هایی که هنوز در این شماره پشتیبانی نمی شوند را بیابید.
همچنین نحوه اعلان گزینه ها نهایی نشده است، بنابراین اگر از هر یک از گزینه های کلاسیک استفاده می کنید، باید با جایگزینی این خط آنها را به گزینه های ماده تبدیل کنید:
chart.draw(data, options);
...با این:
chart.draw(data, google.charts.Scatter.convertOptions(options));
نمودارهای دوگانه Y
گاهی اوقات می خواهید دو سری را در نمودار پراکنده، با دو محور y مستقل نمایش دهید: یک محور چپ برای یک سری، و یک محور راست برای سری دیگر:
توجه داشته باشید که نه تنها دو محور y ما دارای برچسب متفاوتی هستند ("نمره امتحان نهایی" در مقابل "ساعت های مطالعه شده") بلکه هر کدام مقیاس ها و خطوط شبکه مستقل خود را دارند. اگر می خواهید این رفتار را سفارشی کنید، از گزینه های vAxis.gridlines
استفاده کنید.
در کد زیر گزینه های axes
و series
با هم ظاهر دوگانه Y نمودار را مشخص می کنند. گزینه series
مشخص می کند که از کدام محور برای هر کدام استفاده شود ( 'final grade'
و 'hours studied'
؛ آنها نیازی به هیچ ارتباطی با نام ستون ها در جدول داده ندارند). سپس گزینه axes
این نمودار را به نمودار Y دوگانه تبدیل میکند و محور 'Final Exam Grade'
را در سمت چپ و محور 'Hours Studied'
را در سمت راست قرار میدهد.
google.charts.load('current', {'packages':['corechart', 'scatter']}); google.charts.setOnLoadCallback(drawStuff); function drawStuff() { var button = document.getElementById('change-chart'); var chartDiv = document.getElementById('chart_div'); var data = new google.visualization.DataTable(); data.addColumn('number', 'Student ID'); data.addColumn('number', 'Hours Studied'); data.addColumn('number', 'Final'); data.addRows([ [0, 0, 67], [1, 1, 88], [2, 2, 77], [3, 3, 93], [4, 4, 85], [5, 5, 91], [6, 6, 71], [7, 7, 78], [8, 8, 93], [9, 9, 80], [10, 10, 82], [11, 0, 75], [12, 5, 80], [13, 3, 90], [14, 1, 72], [15, 5, 75], [16, 6, 68], [17, 7, 98], [18, 3, 82], [19, 9, 94], [20, 2, 79], [21, 2, 95], [22, 2, 86], [23, 3, 67], [24, 4, 60], [25, 2, 80], [26, 6, 92], [27, 2, 81], [28, 8, 79], [29, 9, 83] ]); var materialOptions = { chart: { title: 'Students\' Final Grades', subtitle: 'based on hours studied' }, width: 800, height: 500, series: { 0: {axis: 'hours studied'}, 1: {axis: 'final grade'} }, axes: { y: { 'hours studied': {label: 'Hours Studied'}, 'final grade': {label: 'Final Exam Grade'} } } }; var classicOptions = { width: 800, series: { 0: {targetAxisIndex: 0}, 1: {targetAxisIndex: 1} }, title: 'Students\' Final Grades - based on hours studied', vAxes: { // Adds titles to each axis. 0: {title: 'Hours Studied'}, 1: {title: 'Final Exam Grade'} } }; function drawMaterialChart() { var materialChart = new google.charts.Scatter(chartDiv); materialChart.draw(data, google.charts.Scatter.convertOptions(materialOptions)); button.innerText = 'Change to Classic'; button.onclick = drawClassicChart; } function drawClassicChart() { var classicChart = new google.visualization.ScatterChart(chartDiv); classicChart.draw(data, classicOptions); button.innerText = 'Change to Material'; button.onclick = drawMaterialChart; } drawMaterialChart(); };
نمودارهای X برتر
توجه: محورهای Top-X فقط برای نمودارهای مواد (یعنی آنهایی که دارای scatter
بسته هستند) در دسترس هستند.
اگر میخواهید برچسبها و عنوان محور X را به جای پایین، در بالای نمودار خود قرار دهید، میتوانید این کار را در نمودارهای Material با گزینه axes.x
:
google.charts.load('current', {'packages':['scatter']}); google.charts.setOnLoadCallback(drawChart); function drawChart () { var data = new google.visualization.DataTable(); data.addColumn('number', 'Hours Studied'); data.addColumn('number', 'Final'); data.addRows([ [0, 67], [1, 88], [2, 77], [3, 93], [4, 85], [5, 91], [6, 71], [7, 78], [8, 93], [9, 80], [10, 82], [0, 75], [5, 80], [3, 90], [1, 72], [5, 75], [6, 68], [7, 98], [3, 82], [9, 94], [2, 79], [2, 95], [2, 86], [3, 67], [4, 60], [2, 80], [6, 92], [2, 81], [8, 79], [9, 83], [3, 75], [1, 80], [3, 71], [3, 89], [4, 92], [5, 85], [6, 92], [7, 78], [6, 95], [3, 81], [0, 64], [4, 85], [2, 83], [3, 96], [4, 77], [5, 89], [4, 89], [7, 84], [4, 92], [9, 98] ]); var options = { width: 800, height: 500, chart: { title: 'Students\' Final Grades', subtitle: 'based on hours studied' }, axes: { x: { 0: {side: 'top'} } } }; var chart = new google.charts.Scatter(document.getElementById('scatter_top_x')); chart.draw(data, google.charts.Scatter.convertOptions(options)); }
بارگذاری
نام بسته google.charts.load
"corechart"
است و نام کلاس google.visualization.ScatterChart
است.
google.charts.load("current", {packages: ["corechart"]});
var visualization = new google.visualization.ScatterChart(container);
برای نمودارهای پراکندگی مواد، نام بسته google.charts.load
"scatter"
است و نام کلاس تجسم google.charts.Scatter
است.
google.charts.load("current", {packages: ["scatter"]});
var visualization = new google.charts.Scatter(container);
فرمت داده
سطرها: هر ردیف در جدول مجموعه ای از نقاط داده را با همان مقدار محور x نشان می دهد.
ستون ها:
ستون 0 | ستون 1 | ... | ستون N | |
---|---|---|---|---|
هدف: | مقادیر نقطه داده X | مقادیر Y سری 1 | ... | مقادیر سری N Y |
نوع داده: | رشته، شماره، یا تاریخ/تاریخ/زمان روز | رشته، شماره، یا تاریخ/تاریخ/زمان روز | ... | رشته، شماره، یا تاریخ/تاریخ/زمان روز |
نقش: | داده ها | داده ها | ... | داده ها |
نقش های ستون اختیاری: | هیچ یک | ... |
برای تعیین چند سری، دو یا چند ستون محور Y را مشخص کنید و مقادیر Y را فقط در یک ستون Y مشخص کنید:
مقادیر X | سری 1 مقادیر Y | سری 2 مقادیر Y |
---|---|---|
10 | خالی | 75 |
20 | خالی | 18 |
33 | خالی | 22 |
55 | 16 | خالی |
14 | 61 | خالی |
48 | 3 | خالی |
گزینه های پیکربندی
نام | |
---|---|
تجمع هدف | چگونه چندین انتخاب داده در راهنمای ابزار جمع می شوند:
aggregationTarget اغلب همراه با selectionMode و tooltip.trigger استفاده می شود، به عنوان مثال:var options = { // Allow multiple // simultaneous selections. selectionMode: 'multiple', // Trigger tooltips // on selections. tooltip: {trigger: 'selection'}, // Group selections // by x-value. aggregationTarget: 'category', }; نوع: رشته پیش فرض: "خودکار" |
انیمیشن.مدت | مدت زمان انیمیشن، بر حسب میلی ثانیه. برای جزئیات، به مستندات انیمیشن مراجعه کنید. نوع: شماره پیش فرض: 0 |
انیمیشن.تسهیل | تابع easing برای انیمیشن اعمال می شود. گزینه های ذیل در دسترس هستند:
نوع: رشته پیش فرض: "خطی" |
انیمیشن.استارت آپ | تعیین می کند که آیا نمودار در قرعه کشی اولیه متحرک می شود یا خیر. اگر نوع: بولی پیش فرض نادرست |
annotations.boxStyle | برای نمودارهایی که از حاشیه نویسی پشتیبانی می کنند، شی var options = { annotations: { boxStyle: { // Color of the box outline. stroke: '#888', // Thickness of the box outline. strokeWidth: 1, // x-radius of the corner curvature. rx: 10, // y-radius of the corner curvature. ry: 10, // Attributes for linear gradient fill. gradient: { // Start color for gradient. color1: '#fbf6a7', // Finish color for gradient. color2: '#33b679', // Where on the boundary to start and // end the color1/color2 gradient, // relative to the upper left corner // of the boundary. x1: '0%', y1: '0%', x2: '100%', y2: '100%', // If true, the boundary for x1, // y1, x2, and y2 is the box. If // false, it's the entire chart. useObjectBoundingBoxUnits: true } } } }; این گزینه در حال حاضر برای نمودارهای ناحیه، نوار، ستون، ترکیب، خط و پراکندگی پشتیبانی می شود. توسط نمودار حاشیه نویسی پشتیبانی نمی شود. نوع: شی پیش فرض: null |
annotations.datum | برای نمودارهایی که از حاشیه نویسی پشتیبانی می کنند، شی annotations.datum به شما امکان می دهد انتخاب نمودارهای Google را برای حاشیه نویسی های ارائه شده برای عناصر داده جداگانه (مانند مقادیر نمایش داده شده با هر نوار در نمودار میله ای) لغو کنید. میتوانید رنگ را با annotations.datum.stem.color ، طول ساقه را با annotations.datum.stem.length ، و سبک را با annotations.datum.style کنترل کنید. نوع: شی پیش فرض: رنگ "سیاه" است. طول 12 است. سبک "نقطه" است. |
حاشیه نویسی. دامنه | برای نمودارهایی که از حاشیه نویسی پشتیبانی می کنند، شی annotations.domain به شما امکان می دهد انتخاب نمودارهای Google برای حاشیه نویسی ارائه شده برای یک دامنه (محور اصلی نمودار، مانند محور X در نمودار خطی معمولی) را نادیده بگیرید. میتوانید رنگ را با annotations.domain.stem.color ، طول ساقه را با annotations.domain.stem.length و سبک را با annotations.domain.style کنترل کنید. نوع: شی پیش فرض: رنگ "سیاه" است. طول 5 است. سبک "نقطه" است. |
annotations.highContrast | برای نمودارهایی که از حاشیه نویسی پشتیبانی می کنند، annotations.highContrast به شما امکان می دهد انتخاب رنگ حاشیه annotations.highContrast توسط نمودارهای Google را نادیده بگیرید. بهطور پیشفرض، annotations.highContrast درست است، که باعث میشود نمودارها یک رنگ حاشیهنویسی با کنتراست خوب انتخاب کنند: رنگهای روشن در پسزمینههای تیره و تیره در روشن. اگر annotations.highContrast را روی false تنظیم کنید و رنگ حاشیه نویسی خود را مشخص نکنید، Google Charts از رنگ سری پیشفرض برای حاشیهنویسی استفاده میکند: نوع: بولی پیش فرض: درست است |
annotations.stem | برای نمودارهایی که از حاشیه نویسی پشتیبانی می کنند، شی annotations.stem به شما امکان می دهد انتخاب نمودارهای Google برای سبک پایه را نادیده بگیرید. می توانید رنگ را با annotations.stem.color و طول ساقه را با annotations.stem.length کنترل کنید. توجه داشته باشید که گزینه طول پایه هیچ تاثیری بر حاشیه نویسی با سبک 'line' ندارد: برای حاشیه نویسی های مبدأ 'line' ، طول پایه همیشه با متن یکسان است و برای حاشیه نویسی دامنه 'line' ، ساقه در کل نمودار گسترش می یابد. . نوع: شی پیش فرض: رنگ "سیاه" است. طول برای حاشیه نویسی دامنه 5 و برای حاشیه نویسی مبدأ 12 است. |
حاشیه نویسی.سبک | برای نمودارهایی که از حاشیه نویسی پشتیبانی می کنند، گزینه annotations.style به شما امکان می دهد انتخاب نوع حاشیه نویسی نمودارهای Google را لغو کنید. می تواند 'line' یا 'point' باشد. نوع: رشته پیش فرض: "نقطه" |
annotations.textStyle | برای نمودارهایی که از حاشیه نویسی پشتیبانی می کنند، شی annotations.textStyle ظاهر متن حاشیه نویسی را کنترل می کند:var options = { annotations: { textStyle: { fontName: 'Times-Roman', fontSize: 18, bold: true, italic: true, // The color of the text. color: '#871b47', // The color of the text outline. auraColor: '#d799ae', // The transparency of the text. opacity: 0.8 } } }; این گزینه در حال حاضر برای نمودارهای ناحیه، نوار، ستون، ترکیب، خط و پراکندگی پشتیبانی می شود. توسط نمودار حاشیه نویسی پشتیبانی نمی شود. نوع: شی پیش فرض: null |
axisTitlesPosition | محل قرار دادن عناوین محورها، در مقایسه با منطقه نمودار. مقادیر پشتیبانی شده:
نوع: رشته پیش فرض: "خارج" |
رنگ پس زمینه | رنگ پس زمینه برای ناحیه اصلی نمودار. می تواند یک رشته رنگی ساده HTML باشد، برای مثال: نوع: رشته یا شی پیش فرض: "سفید" |
backgroundColor.stroke | رنگ حاشیه نمودار، به عنوان یک رشته رنگ HTML. نوع: رشته پیشفرض: '#666' |
backgroundColor.strokeWidth | عرض حاشیه، بر حسب پیکسل. نوع: شماره پیش فرض: 0 |
backgroundColor.fill | رنگ پر کردن نمودار، به عنوان یک رشته رنگ HTML. نوع: رشته پیش فرض: "سفید" |
نمودار. عنوان | برای نمودارهای مواد ، این گزینه عنوان را مشخص می کند. نوع: رشته پیش فرض: null |
نمودار.زیرنویس | برای نمودارهای مواد ، این گزینه زیرنویس را مشخص می کند. فقط Material Charts از زیرنویس ها پشتیبانی می کند. نوع: رشته پیش فرض: null |
نمودار مساحت | یک شی با اعضا برای پیکربندی مکان و اندازه ناحیه نمودار (جایی که خود نمودار رسم شده است، به استثنای محورها و افسانه ها). دو فرمت پشتیبانی می شود: یک عدد یا یک عدد به دنبال ٪. یک عدد ساده یک مقدار در پیکسل است. یک عدد به دنبال آن % یک درصد است. مثال: نوع: شی پیش فرض: null |
chartArea.backgroundColor | رنگ پس زمینه ناحیه نمودار هنگامی که از یک رشته استفاده می شود، می تواند یک رشته هگزا (به عنوان مثال، '#fdc') یا یک نام رنگ انگلیسی باشد. هنگامی که یک شی استفاده می شود، ویژگی های زیر را می توان ارائه داد:
نوع: رشته یا شی پیش فرض: "سفید" |
نمودار Area.left | چقدر می توان نمودار را از حاشیه سمت چپ رسم کرد. نوع: عدد یا رشته پیش فرض: خودکار |
نمودار Area.top | چقدر می توان نمودار را از حاشیه بالایی رسم کرد. نوع: عدد یا رشته پیش فرض: خودکار |
نمودار مساحت.عرض | عرض منطقه نمودار نوع: عدد یا رشته پیش فرض: خودکار |
نمودار مساحت.ارتفاع | ارتفاع منطقه نمودار نوع: عدد یا رشته پیش فرض: خودکار |
رنگ ها | رنگ هایی که برای عناصر نمودار استفاده می شود. آرایه ای از رشته ها، که در آن هر عنصر یک رشته رنگی HTML است، به عنوان مثال: نوع: آرایه از رشته ها پیش فرض: رنگ های پیش فرض |
متقاطع | یک شی حاوی ویژگی های متقاطع برای نمودار. نوع: شی پیش فرض: null |
crosshair.color | رنگ متقاطع، که به صورت نام رنگ (مثلاً "آبی") یا یک مقدار RGB (مثلاً "#adf") بیان می شود. نوع: رشته نوع: پیش فرض |
متقاطع.متمرکز | یک شی حاوی ویژگی های متقاطع هنگام فوکوس. نوع: شی پیش فرض: پیش فرض |
تیرگی. شفافیت | تیرگی متقاطع، با نوع: شماره پیش فرض: 1.0 |
متقابل. جهت گیری | جهت گیری ضربدری، که می تواند فقط برای موهای عمودی «عمودی»، فقط برای موهای افقی «افقی» یا برای موهای متقاطع سنتی «هر دو» باشد. نوع: رشته پیش فرض: "هر دو" |
متقاطع.انتخاب شد | یک شی حاوی ویژگی های متقاطع پس از انتخاب. نوع: شی پیش فرض: پیش فرض |
ضربدری.ماشه | زمان نمایش خطوط متقاطع: روی نوع: رشته پیش فرض: "هر دو" |
curveType | منحنی خطوط را زمانی که عرض خط صفر نباشد کنترل می کند. می تواند یکی از موارد زیر باشد:
نوع: رشته پیش فرض: "هیچ" |
شفافیت داده | شفافیت نقاط داده، با 1.0 کاملاً غیر شفاف و 0.0 کاملاً شفاف. در نمودارهای پراکندگی، هیستوگرام، میله ای و ستونی، این به داده های قابل مشاهده اشاره دارد: نقاط در نمودار پراکندگی و مستطیل ها در بقیه. در نمودارهایی که انتخاب دادهها یک نقطه ایجاد میکند، مانند نمودارهای خط و ناحیه، این به دایرههایی اطلاق میشود که هنگام شناور یا انتخاب ظاهر میشوند. نمودار ترکیبی هر دو رفتار را نشان می دهد و این گزینه روی نمودارهای دیگر تأثیری ندارد. (برای تغییر کدورت خط روند، کدورت خط روند را ببینید.) نوع: شماره پیش فرض: 1.0 |
فعال کردن تعامل | آیا نمودار رویدادهای مبتنی بر کاربر را نشان می دهد یا به تعامل کاربر واکنش نشان می دهد. اگر نادرست باشد، نمودار «انتخاب» یا سایر رویدادهای مبتنی بر تعامل را پرتاب نمیکند (اما رویدادهای آماده یا خطا را پرتاب میکند)، و متن شناور را نمایش نمیدهد یا بسته به ورودی کاربر تغییر نمیکند. نوع: بولی پیش فرض: درست است |
کاوشگر | گزینه این ویژگی آزمایشی است و ممکن است در نسخه های بعدی تغییر کند. توجه: کاوشگر فقط با محورهای پیوسته (مانند اعداد یا تاریخ) کار می کند. نوع: شی پیش فرض: null |
explorer.actions | Google Charts Explorer از سه عمل پشتیبانی می کند:
نوع: آرایه از رشته ها پیشفرض: ['dragToPan', 'rightClickToReset'] |
explorer.axis | به طور پیش فرض، کاربران می توانند در صورت استفاده از گزینه نوع: رشته پیشفرض: هم افقی و هم عمودی |
explorer.keepInBounds | بهطور پیشفرض، کاربران میتوانند بدون توجه به جایی که دادهها هستند، همه جا حرکت کنند. برای اطمینان از اینکه کاربران فراتر از نمودار اصلی حرکت نمی کنند، از نوع: بولی پیش فرض: نادرست |
explorer.maxZoomIn | حداکثری که کاوشگر می تواند بزرگنمایی کند. به طور پیش فرض، کاربران می توانند به اندازه ای بزرگنمایی کنند که فقط 25٪ از نمای اصلی را ببینند. تنظیم نوع: شماره پیش فرض: 0.25 |
explorer.maxZoomOut | حداکثری که کاوشگر می تواند بزرگنمایی کند. بهطور پیشفرض، کاربران میتوانند به اندازهای بزرگنمایی کنند که نمودار تنها 1/4 فضای موجود را اشغال کند. تنظیم نوع: شماره پیش فرض: 4 |
explorer.zoomDelta | وقتی کاربران بزرگنمایی یا کوچکنمایی میکنند، نوع: شماره پیش فرض: 1.5 |
اندازه فونت | اندازه فونت پیشفرض، بر حسب پیکسل، تمام متنهای نمودار. میتوانید با استفاده از ویژگیهای عناصر نمودار خاص، این مورد را لغو کنید. نوع: شماره پیش فرض: خودکار |
نام قلم | صورت فونت پیشفرض برای تمام متنهای نمودار. میتوانید با استفاده از ویژگیهای عناصر نمودار خاص، این مورد را لغو کنید. نوع: رشته پیش فرض: "Arial" |
forceIFrame | نمودار را درون یک قاب درون خطی رسم می کند. (توجه داشته باشید که در IE8، این گزینه نادیده گرفته می شود؛ همه نمودارهای IE8 در i-frame ترسیم می شوند.) نوع: بولی پیش فرض: نادرست |
hAxis | یک شی با اعضایی برای پیکربندی عناصر مختلف محور افقی. برای مشخص کردن ویژگی های این شی، می توانید از نماد لغوی شی استفاده کنید، همانطور که در اینجا نشان داده شده است: { title: 'Hello', titleTextStyle: { color: '#FF0000' } } نوع: شی پیش فرض: null |
hAxis.baseline | خط مبنا برای محور افقی. نوع: شماره پیش فرض: خودکار |
hAxis.baselineColor | رنگ خط مبنا برای محور افقی. می تواند هر رشته رنگی HTML باشد، به عنوان مثال: نوع: شماره پیش فرض: "سیاه" |
hAxis.direction | جهتی که در آن مقادیر در امتداد محور افقی رشد می کنند. برای معکوس کردن ترتیب مقادیر، نوع: 1 یا -1 پیش فرض: 1 |
hAxis.format | یک رشته قالب برای برچسب های محورهای عددی. این زیر مجموعه ای از الگوی ICU است . برای مثال،
قالب بندی واقعی اعمال شده بر روی برچسب از محلی که API با آن بارگذاری شده است مشتق شده است. برای جزئیات بیشتر، به بارگیری نمودارها با یک منطقه خاص مراجعه کنید. در محاسبه مقادیر تیک و خطوط شبکه، چندین ترکیب جایگزین از همه گزینههای خط شبکه مربوطه در نظر گرفته میشود و در صورت تکرار یا همپوشانی برچسبهای تیک قالببندی شده، گزینههای جایگزین رد خواهند شد. بنابراین اگر میخواهید فقط مقادیر تیک اعداد صحیح را نشان دهد، میتوانید نوع: رشته پیش فرض: خودکار |
hAxis.gridlines | یک شی با خصوصیات برای پیکربندی خطوط شبکه در محور افقی. توجه داشته باشید که خطوط شبکه محور افقی به صورت عمودی ترسیم می شوند. برای مشخص کردن ویژگی های این شی، می توانید از نماد لغوی شی استفاده کنید، همانطور که در اینجا نشان داده شده است: {color: '#333', minSpacing: 20} نوع: شی پیش فرض: null |
hAxis.gridlines.color | رنگ خطوط شبکه افقی در داخل منطقه نمودار. یک رشته رنگ معتبر HTML را مشخص کنید. نوع: رشته پیشفرض: '#CCC' |
hAxis.gridlines.count | تعداد تقریبی خطوط شبکه افقی در داخل منطقه نمودار. اگر یک عدد مثبت برای نوع: شماره پیش فرض: -1 |
hAxis.gridlines.units | وقتی با خطوط شبکه محاسبه شده نمودار استفاده می شود، قالب پیش فرض را برای جنبه های مختلف انواع داده های تاریخ/تاریخ/زمان روز لغو می کند. امکان قالب بندی سال ها، ماه ها، روزها، ساعت ها، دقیقه ها، ثانیه ها و میلی ثانیه ها را فراهم می کند. قالب کلی: gridlines: { units: { years: {format: [/*format strings here*/]}, months: {format: [/*format strings here*/]}, days: {format: [/*format strings here*/]} hours: {format: [/*format strings here*/]} minutes: {format: [/*format strings here*/]} seconds: {format: [/*format strings here*/]}, milliseconds: {format: [/*format strings here*/]}, } } اطلاعات اضافی را می توان در تاریخ و زمان یافت. نوع: شی پیش فرض: null |
hAxis.minorGridlines | یک شی با اعضایی برای پیکربندی خطوط شبکه فرعی در محور افقی، مشابه گزینه hAxis.gridlines. نوع: شی پیش فرض: null |
hAxis.minorGridlines.color | رنگ خطوط شبکه افقی فرعی در داخل منطقه نمودار. یک رشته رنگ معتبر HTML را مشخص کنید. نوع: رشته پیشفرض: ترکیبی از خط شبکه و رنگهای پسزمینه |
hAxis.minorGridlines.count | گزینه نوع: شماره پیش فرض: 1 |
hAxis.minorGridlines.units | در صورت استفاده از خطوط کوچک گریدهای محاسبه شده نمودار، قالب پیش فرض را برای جنبه های مختلف انواع داده های تاریخ/تاریخ/زمان روز باطل می کند. امکان قالب بندی سال ها، ماه ها، روزها، ساعت ها، دقیقه ها، ثانیه ها و میلی ثانیه ها را فراهم می کند. قالب کلی: gridlines: { units: { years: {format: [/*format strings here*/]}, months: {format: [/*format strings here*/]}, days: {format: [/*format strings here*/]} hours: {format: [/*format strings here*/]} minutes: {format: [/*format strings here*/]} seconds: {format: [/*format strings here*/]}, milliseconds: {format: [/*format strings here*/]}, } } اطلاعات اضافی را می توان در تاریخ و زمان یافت. نوع: شی پیش فرض: null |
hAxis.logScale | ویژگی نوع: بولی پیش فرض: نادرست |
hAxis.scaleType | ویژگی
نوع: رشته پیش فرض: null |
hAxis.textPosition | موقعیت متن محور افقی، نسبت به ناحیه نمودار. مقادیر پشتیبانی شده: "out"، "in"، "none". نوع: رشته پیش فرض: "خارج" |
hAxis.textStyle | یک شی که سبک متن محور افقی را مشخص می کند. شیء دارای این قالب است: { color: <string>, fontName: <string>, fontSize: <number>, bold: <boolean>, italic: <boolean> } نوع: شی پیشفرض: {color: 'black', fontName: <global-font-name>, fontSize: <global-font-size>} |
hAxis.ticks | تیک های محور X را که به طور خودکار تولید می شوند با آرایه مشخص شده جایگزین می کند. هر عنصر آرایه باید یا یک مقدار تیک معتبر (مانند یک عدد، تاریخ، تاریخ، یا زمان روز)، یا یک شی باشد. اگر یک شی است، باید یک ویژگی viewWindow به طور خودکار گسترش مییابد تا تیکهای حداقل و حداکثر را شامل شود، مگر اینکه یک مثال ها:
نوع: آرایه ای از عناصر پیش فرض: خودکار |
hAxis.title | ویژگی نوع: رشته پیش فرض: null |
hAxis.titleTextStyle | یک شی که سبک متن عنوان محور افقی را مشخص می کند. شیء دارای این قالب است: { color: <string>, fontName: <string>, fontSize: <number>, bold: <boolean>, italic: <boolean> } نوع: شی پیشفرض: {color: 'black', fontName: <global-font-name>, fontSize: <global-font-size>} |
hAxis.maxValue | حداکثر مقدار محور افقی را به مقدار مشخص شده منتقل می کند. این در اکثر نمودارها به سمت راست خواهد بود. اگر این مقدار روی مقداری کوچکتر از حداکثر مقدار x داده تنظیم شود، نادیده گرفته می شود. نوع: شماره پیش فرض: خودکار |
hAxis.minValue | مقدار min محور افقی را به مقدار مشخص شده منتقل می کند. این در اکثر نمودارها به سمت چپ خواهد بود. اگر این مقدار روی مقداری بیشتر از حداقل مقدار x داده تنظیم شود نادیده گرفته می شود. نوع: شماره پیش فرض: خودکار |
hAxis.viewWindowMode | نحوه مقیاس بندی محور افقی برای نمایش مقادیر در ناحیه نمودار را مشخص می کند. مقادیر رشته زیر پشتیبانی می شوند:
نوع: رشته پیش فرض: معادل «زیبا» است، اما در صورت استفاده از haxis.viewWindow.min و haxis.viewWindow.max اولویت دارند. |
hAxis.viewWindow | محدوده برش محور افقی را مشخص می کند. نوع: شی پیش فرض: null |
hAxis.viewWindow.max | حداکثر مقدار داده افقی برای ارائه. وقتی نوع: شماره پیش فرض: خودکار |
hAxis.viewWindow.min | حداقل مقدار داده افقی برای ارائه. وقتی نوع: شماره پیش فرض: خودکار |
ارتفاع | ارتفاع نمودار، بر حسب پیکسل. نوع: شماره پیش فرض: ارتفاع عنصر حاوی |
افسانه | یک شی با اعضا برای پیکربندی جنبه های مختلف افسانه. برای مشخص کردن ویژگی های این شی، می توانید از نماد لغوی شی استفاده کنید، همانطور که در اینجا نشان داده شده است: {position: 'top', textStyle: {color: 'blue', fontSize: 16}} نوع: شی پیش فرض: null |
افسانه.تراز | تراز افسانه. می تواند یکی از موارد زیر باشد:
شروع، مرکز و پایان نسبت به سبک - عمودی یا افقی - افسانه است. برای مثال، در افسانه «راست»، «شروع» و «پایان» به ترتیب در بالا و پایین هستند. برای افسانه "بالا"، "شروع" و "پایان" به ترتیب در سمت چپ و راست منطقه قرار می گیرند. مقدار پیش فرض به موقعیت افسانه بستگی دارد. برای افسانههای «پایین»، پیشفرض «مرکز» است. افسانه های دیگر به طور پیش فرض "شروع" هستند. نوع: رشته پیش فرض: خودکار |
legend.maxLines | حداکثر تعداد خطوط در افسانه. این را روی عددی بزرگتر از یک تنظیم کنید تا خطوطی به افسانه خود اضافه کنید. توجه: منطق دقیق مورد استفاده برای تعیین تعداد واقعی خطوط ارائه شده هنوز در جریان است. این گزینه در حال حاضر فقط زمانی کار می کند که legend.position 'بالا' باشد. نوع: شماره پیش فرض: 1 |
legend.pageIndex | فهرست اولیه صفحه بر اساس صفر انتخاب شده از افسانه. نوع: شماره پیش فرض: 0 |
افسانه. موقعیت | موقعیت افسانه. می تواند یکی از موارد زیر باشد:
نوع: رشته پیش فرض: "درست" |
legend.textStyle | یک شی که سبک متن افسانه را مشخص می کند. شیء دارای این قالب است: { color: <string>, fontName: <string>, fontSize: <number>, bold: <boolean>, italic: <boolean> } نوع: شی پیشفرض: {color: 'black', fontName: <global-font-name>, fontSize: <global-font-size>} |
عرض خط | عرض خط بر حسب پیکسل از صفر برای پنهان کردن تمام خطوط استفاده کنید و فقط نقاط را نشان دهید. نوع: شماره پیش فرض: 0 |
گرایش | جهت گیری نمودار. وقتی روی نوع: رشته پیش فرض: "افقی" |
نقطه شکل | شکل تک تک عناصر داده: «دایره»، «مثلث»، «مربع»، «الماس»، «ستاره» یا «چند ضلعی». برای مثال به مستندات امتیاز مراجعه کنید. نوع: رشته پیش فرض: "دایره" |
اندازه نقطه | قطر نقاط داده، بر حسب پیکسل. از صفر برای پنهان کردن تمام نقاط استفاده کنید. با استفاده از ویژگی نوع: شماره پیش فرض: 7 |
نقاط قابل مشاهده | تعیین می کند که آیا نقاط نمایش داده می شوند یا خیر. برای پنهان کردن تمام نقاط، روی این را می توان با استفاده از نقش سبک به شکل نوع: بولی پیش فرض: درست است |
انتخاب حالت | وقتی نوع: رشته پیش فرض: "تک" |
سلسله | آرایه ای از اشیاء که هر کدام فرمت سری مربوطه را در نمودار توصیف می کنند. برای استفاده از مقادیر پیش فرض برای یک سری، یک شی خالی {} را مشخص کنید. اگر یک سری یا یک مقدار مشخص نشده باشد، از مقدار جهانی استفاده می شود. هر شی از ویژگی های زیر پشتیبانی می کند:
میتوانید آرایهای از اشیاء را مشخص کنید که هر کدام به ترتیب دادهشده برای سری اعمال میشوند، یا میتوانید شیای را مشخص کنید که در آن هر فرزند یک کلید عددی داشته باشد که نشان میدهد برای کدام سری اعمال میشود. به عنوان مثال، دو اعلان زیر یکسان هستند و سری اول را سیاه و غایب از افسانه، و چهارم را قرمز و غایب از افسانه اعلام میکنند: series: [ {color: 'black', visibleInLegend: false}, {}, {}, {color: 'red', visibleInLegend: false} ] series: { 0:{color: 'black', visibleInLegend: false}, 3:{color: 'red', visibleInLegend: false} } نوع: آرایه ای از اشیاء یا شی با اشیاء تودرتو پیش فرض: {} |
موضوع | تم مجموعه ای از مقادیر گزینه از پیش تعریف شده است که برای دستیابی به یک رفتار نمودار یا جلوه بصری خاص با هم کار می کنند. در حال حاضر فقط یک موضوع موجود است:
نوع: رشته پیش فرض: null |
عنوان | متن برای نمایش در بالای نمودار. نوع: رشته پیش فرض: بدون عنوان |
محل عنوان | محل قرار دادن عنوان نمودار، در مقایسه با منطقه نمودار. مقادیر پشتیبانی شده:
نوع: رشته پیش فرض: "خارج" |
titleTextStyle | یک شی که سبک متن عنوان را مشخص می کند. شیء دارای این قالب است: { color: <string>, fontName: <string>, fontSize: <number>, bold: <boolean>, italic: <boolean> } نوع: شی پیشفرض: {color: 'black', fontName: <global-font-name>, fontSize: <global-font-size>} |
راهنمای ابزار | یک شی با اعضا برای پیکربندی عناصر مختلف راهنمای ابزار. برای مشخص کردن ویژگی های این شی، می توانید از نماد لغوی شی استفاده کنید، همانطور که در اینجا نشان داده شده است: {textStyle: {color: '#FF0000'}, showColorCode: true} نوع: شی پیش فرض: null |
tooltip.ignoreBounds | اگر روی توجه: این فقط برای نکات ابزار HTML اعمال می شود. اگر این مورد با راهنمایی ابزار SVG فعال شود، هر سرریزی خارج از محدوده نمودار برش داده می شود. برای جزئیات بیشتر به سفارشی کردن محتوای راهنمای ابزار مراجعه کنید. نوع: بولی پیش فرض: نادرست |
tooltip.isHtml | اگر روی true تنظیم شده باشد، از نکات ابزار رندر شده HTML (به جای SVG) استفاده کنید. برای جزئیات بیشتر به سفارشی کردن محتوای راهنمای ابزار مراجعه کنید. توجه: سفارشیسازی محتوای راهنمای ابزار HTML از طریق نقش داده ستون راهنمای ابزار توسط تجسم نمودار حباب پشتیبانی نمیشود . نوع: بولی پیش فرض: نادرست |
tooltip.showColorCode | اگر درست است، مربع های رنگی را در کنار اطلاعات سری در راهنمای ابزار نشان دهید. Type: boolean Default: false |
tooltip.textStyle | An object that specifies the tooltip text style. The object has this format: { color: <string>, fontName: <string>, fontSize: <number>, bold: <boolean>, italic: <boolean> } The Type: object Default: {color: 'black', fontName: <global-font-name>, fontSize: <global-font-size>} |
tooltip.trigger | The user interaction that causes the tooltip to be displayed:
Type: string Default: 'focus' |
trendlines | Displays trendlines on the charts that support them. By default, linear trendlines are used, but this can be customized with the Trendlines are specified on a per-series basis, so most of the time your options will look like this: var options = { trendlines: { 0: { type: 'linear', color: 'green', lineWidth: 3, opacity: 0.3, showR2: true, visibleInLegend: true } } } Type: object Default: null |
trendlines.n.color | The color of the trendline , expressed as either an English color name or a hex string. Type: string Default: default series color |
trendlines.n.degree | For trendlines of Type: number Default: 3 |
trendlines.n.labelInLegend | If set, the trendline will appear in the legend as this string. Type: string Default: null |
trendlines.n.lineWidth | The line width of the trendline , in pixels. Type: number Default: 2 |
trendlines.n.opacity | The transparency of the trendline , from 0.0 (transparent) to 1.0 (opaque). Type: number Default: 1.0 |
trendlines.n.pointSize | Trendlines are constucted by stamping a bunch of dots on the chart; this rarely-needed option lets you customize the size of the dots. The trendline's Type: number Default: 1 |
trendlines.n.pointsVisible | Trendlines are constucted by stamping a bunch of dots on the chart. The trendline's Type: boolean Default: true |
trendlines.n.showR2 | Whether to show the coefficient of determination in the legend or trendline tooltip. Type: boolean Default: false |
trendlines.n.type | Whether the trendlines is Type: string Default: linear |
trendlines.n.visibleInLegend | Whether the trendline equation appears in the legend. (It will appear in the trendline tooltip.) Type: boolean Default: false |
vAxis | An object with members to configure various vertical axis elements. To specify properties of this object, you can use object literal notation, as shown here: {title: 'Hello', titleTextStyle: {color: '#FF0000'}} Type: object Default: null |
vAxis.baseline | Type: number Default: automatic |
vAxis.baselineColor | Specifies the color of the baseline for the vertical axis. Can be any HTML color string, for example: Type: number Default: 'black' |
vAxis.direction | The direction in which the values along the vertical axis grow. By default, low values are on the bottom of the chart. Specify Type: 1 or -1 Default: 1 |
vAxis.format | A format string for numeric axis labels. This is a subset of the ICU pattern set . For instance,
The actual formatting applied to the label is derived from the locale the API has been loaded with. For more details, see loading charts with a specific locale . In computing tick values and gridlines, several alternative combinations of all the relevant gridline options will be considered and alternatives will be rejected if the formatted tick labels would be duplicated or overlap. So you can specify Type: string Default: auto |
vAxis.gridlines | An object with members to configure the gridlines on the vertical axis. Note that vertical axis gridlines are drawn horizontally. To specify properties of this object, you can use object literal notation, as shown here: {color: '#333', minSpacing: 20} Type: object Default: null |
vAxis.gridlines.color | The color of the vertical gridlines inside the chart area. Specify a valid HTML color string. Type: string Default: '#CCC' |
vAxis.gridlines.count | The approximate number of horizontal gridlines inside the chart area. If you specify a positive number for Type: number Default: -1 |
vAxis.gridlines.units | Overrides the default format for various aspects of date/datetime/timeofday data types when used with chart computed gridlines. Allows formatting for years, months, days, hours, minutes, seconds, and milliseconds. General format is: gridlines: { units: { years: {format: [/*format strings here*/]}, months: {format: [/*format strings here*/]}, days: {format: [/*format strings here*/]}, hours: {format: [/*format strings here*/]}, minutes: {format: [/*format strings here*/]}, seconds: {format: [/*format strings here*/]}, milliseconds: {format: [/*format strings here*/]} } } Additional information can be found in Dates and Times . Type: object Default: null |
vAxis.minorGridlines | An object with members to configure the minor gridlines on the vertical axis, similar to the vAxis.gridlines option. Type: object Default: null |
vAxis.minorGridlines.color | The color of the vertical minor gridlines inside the chart area. Specify a valid HTML color string. Type: string Default: A blend of the gridline and background colors |
vAxis.minorGridlines.count | The minorGridlines.count option is mostly deprecated, except for disabling minor gridlines by setting the count to 0. The number of minor gridlines depends on the interval between major gridlines (see vAxis.gridlines.interval) and the minimum required space (see vAxis.minorGridlines.minSpacing). Type: number Default: 1 |
vAxis.minorGridlines.units | Overrides the default format for various aspects of date/datetime/timeofday data types when used with chart computed minorGridlines. Allows formatting for years, months, days, hours, minutes, seconds, and milliseconds. General format is: gridlines: { units: { years: {format: [/*format strings here*/]}, months: {format: [/*format strings here*/]}, days: {format: [/*format strings here*/]} hours: {format: [/*format strings here*/]} minutes: {format: [/*format strings here*/]} seconds: {format: [/*format strings here*/]}, milliseconds: {format: [/*format strings here*/]}, } } Additional information can be found in Dates and Times . Type: object Default: null |
vAxis.logScale | If true, makes the vertical axis a logarithmic scale. Note: All values must be positive. Type: boolean Default: false |
vAxis.scaleType |
Type: string Default: null |
vAxis.textPosition | Position of the vertical axis text, relative to the chart area. Supported values: 'out', 'in', 'none'. Type: string Default: 'out' |
vAxis.textStyle | An object that specifies the vertical axis text style. The object has this format: { color: <string>, fontName: <string>, fontSize: <number>, bold: <boolean>, italic: <boolean> } The Type: object Default: {color: 'black', fontName: <global-font-name>, fontSize: <global-font-size>} |
vAxis.ticks | Replaces the automatically generated Y-axis ticks with the specified array. Each element of the array should be either a valid tick value (such as a number, date, datetime, or timeofday), or an object. If it's an object, it should have a The viewWindow will be automatically expanded to include the min and max ticks unless you specify a Examples:
Type: Array of elements Default: auto |
vAxis.title | Type: string Default: no title |
vAxis.titleTextStyle | An object that specifies the vertical axis title text style. The object has this format: { color: <string>, fontName: <string>, fontSize: <number>, bold: <boolean>, italic: <boolean> } The Type: object Default: {color: 'black', fontName: <global-font-name>, fontSize: <global-font-size>} |
vAxis.maxValue | Moves the max value of the vertical axis to the specified value; this will be upward in most charts. Ignored if this is set to a value smaller than the maximum y-value of the data. Type: number Default: automatic |
vAxis.minValue | Moves the min value of the vertical axis to the specified value; this will be downward in most charts. Ignored if this is set to a value greater than the minimum y-value of the data. Type: number Default: null |
vAxis.viewWindowMode | Specifies how to scale the vertical axis to render the values within the chart area. The following string values are supported:
Type: string Default: Equivalent to 'pretty', but vaxis.viewWindow.min and vaxis.viewWindow.max take precedence if used. |
vAxis.viewWindow | Specifies the cropping range of the vertical axis. Type: object Default: null |
vAxis.viewWindow.max | The maximum vertical data value to render. Ignored when Type: number Default: auto |
vAxis.viewWindow.min | The minimum vertical data value to render. Ignored when Type: number Default: auto |
width | Width of the chart, in pixels. Type: number Default: width of the containing element |
Methods
Method | |
---|---|
draw(data, options) | Draws the chart. The chart accepts further method calls only after the Return Type: none |
getAction(actionID) | Returns the tooltip action object with the requested Return Type: object |
getBoundingBox(id) | Returns an object containing the left, top, width, and height of chart element
Values are relative to the container of the chart. Call this after the chart is drawn. Return Type: object |
getChartAreaBoundingBox() | Returns an object containing the left, top, width, and height of the chart content (ie, excluding labels and legend):
Values are relative to the container of the chart. Call this after the chart is drawn. Return Type: object |
getChartLayoutInterface() | Returns an object containing information about the onscreen placement of the chart and its elements. The following methods can be called on the returned object:
Call this after the chart is drawn. Return Type: object |
getHAxisValue(xPosition, optional_axis_index) | Returns the horizontal data value at Example: Call this after the chart is drawn. Return Type: number |
getImageURI() | Returns the chart serialized as an image URI. Call this after the chart is drawn. See Printing PNG Charts . Return Type: string |
getSelection() | Returns an array of the selected chart entities. Selectable entities are points and legend entries. A point corresponds to a cell in the data table, and a legend entry to a column (row index is null). For this chart, only one entity can be selected at any given moment. Return Type: Array of selection elements |
getVAxisValue(yPosition, optional_axis_index) | Returns the vertical data value at Example: Call this after the chart is drawn. Return Type: number |
getXLocation(dataValue, optional_axis_index) | Returns the pixel x-coordinate of Example: Call this after the chart is drawn. Return Type: number |
getYLocation(dataValue, optional_axis_index) | Returns the pixel y-coordinate of Example: Call this after the chart is drawn. Return Type: number |
removeAction(actionID) | Removes the tooltip action with the requested Return Type: none |
setAction(action) | Sets a tooltip action to be executed when the user clicks on the action text. The Any and all tooltip actions should be set prior to calling the chart's Return Type: none |
setSelection() | Selects the specified chart entities. Cancels any previous selection. Selectable entities are points and legend entries. A point corresponds to a cell in the data table, and a legend entry to a column (row index is null). For this chart, only one entity can be selected at a time. Return Type: none |
clearChart() | Clears the chart, and releases all of its allocated resources. Return Type: none |
Events
For more information on how to use these events, see Basic Interactivity , Handling Events , and Firing Events .
Name | |
---|---|
animationfinish | Fired when transition animation is complete. Properties: none |
click | Fired when the user clicks inside the chart. Can be used to identify when the title, data elements, legend entries, axes, gridlines, or labels are clicked. Properties: targetID |
error | Fired when an error occurs when attempting to render the chart. Properties: id, message |
legendpagination | Fired when the user clicks legend pagination arrows. Passes back the current legend zero-based page index and the total number of pages. Properties: currentPageIndex, totalPages |
onmouseover | Fired when the user mouses over a visual entity. Passes back the row and column indices of the corresponding data table element. Properties: row, column |
onmouseout | Fired when the user mouses away from a visual entity. Passes back the row and column indices of the corresponding data table element. Properties: row, column |
ready | The chart is ready for external method calls. If you want to interact with the chart, and call methods after you draw it, you should set up a listener for this event before you call the Properties: none |
select | Fired when the user clicks a visual entity. To learn what has been selected, call Properties: none |
Data policy
All code and data are processed and rendered in the browser. No data is sent to any server.