ui.Chart.feature মডিউলে Feature এবং FeatureCollection অবজেক্ট থেকে চার্ট রেন্ডার করার জন্য
ফাংশনের একটি সেট রয়েছে। ফাংশনের পছন্দ
চার্টে ডেটার বিন্যাস নির্ধারণ করে, অর্থাৎ, x- এবং y-অক্ষের মান কী নির্ধারণ করে
এবং সিরিজ কী নির্ধারণ করে। আপনার উদ্দেশ্যের জন্য সেরা ফাংশন এবং চার্টের ধরন নির্ধারণ করতে নিম্নলিখিত ফাংশনের বিবরণ এবং উদাহরণ ব্যবহার করুন।
চার্ট ফাংশন
প্রতিটি ফাংশন কীভাবে চার্টে ফিচার ও তাদের প্রপার্টি সাজায় তা বোঝার জন্য ভিজ্যুয়াল গাইড হিসেবে নিম্নলিখিত প্লট ডায়াগ্রাম ব্যবহার করুন; অর্থাৎ, কোন এলিমেন্ট x-এর মান, y-এর মান ও সিরিজ নির্ধারণ করে।
বেছে নেওয়া প্রপার্টির ভ্যালু অনুযায়ী x-অ্যাক্সিসে ফিচার প্লট করা হয়। সিরিজকে প্রপার্টির নামের তালিকা দ্বারা সংজ্ঞায়িত করা হয় যার মান y-অক্ষ বরাবর প্লট করা হয়।
ফিচারের প্রপার্টি x-অক্ষে নাম অনুযায়ী প্লট করা হয়; প্রদত্ত প্রপার্টির ভ্যালু y-অক্ষে প্লট করা হয়। সিরিজ হল বেছে নেওয়া প্রপার্টির ভ্যালু দ্বারা লেবেল করা ফিচার।
বেছে নেওয়া প্রপার্টির ভ্যালু অনুযায়ী x-অ্যাক্সিসে ফিচার প্লট করা হয়। সিরিজ প্রদত্ত প্রপার্টির অনন্য মান দ্বারা সংজ্ঞায়িত করা হয়। Y-অক্ষ পজিশন কোনও প্রদত্ত প্রপার্টির ভ্যালু দ্বারা নির্ধারিত হয়।
বেছে নেওয়া প্রপার্টির ভ্যালুর জন্য ফ্রিকোয়েন্সি হিস্টোগ্রাম।
- X-অক্ষ: বেছে নেওয়া প্রপার্টির ভ্যালুর জন্য হিস্টোগ্রাম বাকেট
- Y-অক্ষ: প্রতিটি হিস্টোগ্রাম বাকেটের জন্য উপযুক্ত ফিচারের ফ্রিকোয়েন্সি
উদাহরণ ডেটা
নিম্নলিখিত উদাহরণগুলি তিনটি ইকো-রিজিয়ন ফিচার নিয়ে গঠিত FeatureCollection-এর উপর নির্ভর করে, যার প্রপার্টি জলবায়ুর স্বাভাবিক অবস্থা বর্ণনা করে।
উদাহরণ ডেটা কীভাবে তৈরি করা হয়েছে তা দেখুন
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Define three representative ecoregions in the USA. var desert = ee.Feature( ee.Geometry.Rectangle(-109.21, 31.42, -108.3, 32.03), {label: 'Desert', value: 0}); var forest = ee.Feature( ee.Geometry.Rectangle(-122.73, 43.45, -122.28, 43.91), {label: 'Forest', value: 1}); var grassland = ee.Feature( ee.Geometry.Rectangle(-101.81, 41.7, -100.53, 42.51), {label: 'Grassland', value: 2}); // Combine features into a feature collection. var ecoregions = ee.FeatureCollection([desert, forest, grassland]); // Load PRISM climate normals image collection; convert images to bands. var normClim = ee.ImageCollection('OREGONSTATE/PRISM/Norm91m').toBands(); // Summarize climate normals for each ecoregion feature as a set or properties. ecoregions = normClim.reduceRegions( {collection: ecoregions, reducer: ee.Reducer.mean(), scale: 5e4}); // Add a property for whether January temperature is warm or not. ecoregions = ecoregions.map(function(ecoregion) { return ecoregion.set('warm', ee.Number(ecoregion.get('01_tmean')).gt(0)); });
ui.Chart.feature.byFeature
কলাম চার্ট
ফিচারগুলি x-অ্যাক্সিস বরাবর প্লট করা হয়, যা একটি নির্বাচিত প্রপার্টির মান দ্বারা লেবেল করা হয়। প্রপার্টির নামের তালিকা দ্বারা সংজ্ঞায়িত সংলগ্ন কলাম দ্বারা সিরিজ উপস্থাপন করা হয় যার মান y-অক্ষ বরাবর প্লট করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define the chart and print it to the console. var chart = ui.Chart.feature .byFeature({ features: ecoregions.select('[0-9][0-9]_tmean|label'), xProperty: 'label', }) .setSeriesNames([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]) .setChartType('ColumnChart') .setOptions({ title: 'Average Monthly Temperature by Ecoregion', hAxis: {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}}, vAxis: { title: 'Temperature (°C)', titleTextStyle: {italic: false, bold: true} }, colors: [ '604791', '1d6b99', '39a8a7', '0f8755', '76b349', 'f0af07', 'e37d05', 'cf513e', '96356f', '724173', '9c4f97', '696969' ] }); print(chart);
বার চার্ট
ফিচারগুলি y-অ্যাক্সিস বরাবর প্লট করা হয়, যা একটি নির্বাচিত প্রপার্টির মান দ্বারা লেবেল করা হয়। প্রপার্টির নামের তালিকা দ্বারা সংজ্ঞায়িত পাশাপাশি থাকা বারের মাধ্যমে সিরিজ দেখানো হয় যার ভ্যালু x-অ্যাক্সিস বরাবর প্লট করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define the chart and print it to the console. var chart = ui.Chart.feature .byFeature({ features: ecoregions.select('[0-9][0-9]_tmean|label'), xProperty: 'label', }) .setSeriesNames([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]) .setChartType('BarChart') .setOptions({ title: 'Average Monthly Temperature by Ecoregion', hAxis: { title: 'Temperature (°C)', titleTextStyle: {italic: false, bold: true} }, vAxis: {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}}, colors: [ '604791', '1d6b99', '39a8a7', '0f8755', '76b349', 'f0af07', 'e37d05', 'cf513e', '96356f', '724173', '9c4f97', '696969' ] }); print(chart);
স্ট্যাকড কলাম চার্ট
চূড়ান্ত
ফিচারগুলি x-অ্যাক্সিস বরাবর প্লট করা হয়, যা একটি নির্বাচিত প্রপার্টির মান দ্বারা লেবেল করা হয়। সিরিজকে স্ট্যাক করা কলামের মাধ্যমে দেখানো হয় যা প্রপার্টির নামের তালিকা দ্বারা সংজ্ঞায়িত করা হয় এবং এর ভ্যালু y-অ্যাক্সিস বরাবর ক্রমবর্ধমান সিরিজের যোগফল হিসেবে প্লট করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define the chart and print it to the console. var chart = ui.Chart.feature .byFeature({ features: ecoregions.select('[0-9][0-9]_ppt|label'), xProperty: 'label' }) .setSeriesNames([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]) .setChartType('ColumnChart') .setOptions({ title: 'Average Monthly Precipitation by Ecoregion', hAxis: {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}}, vAxis: { title: 'Precipitation (mm)', titleTextStyle: {italic: false, bold: true} }, colors: [ '604791', '1d6b99', '39a8a7', '0f8755', '76b349', 'f0af07', 'e37d05', 'cf513e', '96356f', '724173', '9c4f97', '696969' ], isStacked: 'absolute' }); print(chart);
আত্মীয়
ফিচারগুলি x-অ্যাক্সিস বরাবর প্লট করা হয়, যা একটি নির্বাচিত প্রপার্টির মান দ্বারা লেবেল করা হয়। সিরিজকে স্ট্যাক করা কলামের মাধ্যমে দেখানো হয় যা প্রপার্টির নামের তালিকা দ্বারা সংজ্ঞায়িত করা হয় যার মান y-অক্ষে যোগ করা সিরিজের শতাংশ হিসেবে প্লট করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define the chart and print it to the console. var chart = ui.Chart.feature .byFeature({ features: ecoregions.select('[0-9][0-9]_ppt|label'), xProperty: 'label' }) .setSeriesNames([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]) .setChartType('ColumnChart') .setOptions({ title: 'Average Monthly Precipitation by Ecoregion', hAxis: {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}}, vAxis: { title: 'Precipitation (mm)', titleTextStyle: {italic: false, bold: true} }, colors: [ '604791', '1d6b99', '39a8a7', '0f8755', '76b349', 'f0af07', 'e37d05', 'cf513e', '96356f', '724173', '9c4f97', '696969' ], isStacked: 'percent' }); print(chart);
স্ক্যাটার চার্ট
ফিচারগুলি x-অ্যাক্সিস বরাবর প্লট করা হয়, যা একটি নির্বাচিত প্রপার্টির মান দ্বারা লেবেল করা হয়। সিরিজকে প্রপার্টির নামের তালিকা দ্বারা সংজ্ঞায়িত পয়েন্ট দ্বারা উপস্থাপন করা হয় যার মান y-অক্ষ বরাবর প্লট করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define the chart and print it to the console. var chart = ui.Chart.feature .byFeature({ features: ecoregions, xProperty: 'label', yProperties: ['01_tmean', '07_tmean'] }) .setSeriesNames(['Jan', 'Jul']) .setChartType('ScatterChart') .setOptions({ title: 'Average Monthly Temperature by Ecoregion', hAxis: {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}}, vAxis: { title: 'Temperature (°C)', titleTextStyle: {italic: false, bold: true} }, pointSize: 10, colors: ['1d6b99', 'cf513e'], }); print(chart);
কম্বো চার্ট
ফিচারগুলি x-অ্যাক্সিস বরাবর প্লট করা হয়, যা একটি নির্বাচিত প্রপার্টির মান দ্বারা লেবেল করা হয়। সিরিজ পয়েন্ট ও কলামের মাধ্যমে দেখানো হয় যা প্রপার্টির নামের তালিকা দ্বারা সংজ্ঞায়িত করা হয় যার ভ্যালু y-অক্ষ বরাবর প্লট করা হয়। এই চার্টটি দুটি অক্ষ এবং সিরিজ-নির্দিষ্ট স্টাইলিং ব্যবহার করে তৈরি করা হয়েছে।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define the chart and print it to the console. var chart = ui.Chart.feature .byFeature({ features: ecoregions, xProperty: 'label', yProperties: ['06_ppt', '06_tmean'] }) .setSeriesNames(['Precipitation', 'Temperature']) .setChartType('ColumnChart') .setOptions({ title: 'Average June Temperature and Precipitation by Ecoregion', series: { 0: {targetAxisIndex: 1, type: 'bar', color: '1d6b99'}, 1: { targetAxisIndex: 0, type: 'line', lineWidth: 0, pointSize: 10, color: 'e37d05' } }, hAxis: {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}}, vAxes: { 0: { title: 'Temperature (°C)', baseline: 0, titleTextStyle: {italic: false, bold: true, color: 'e37d05'} }, 1: { title: 'Precipitation (mm)', titleTextStyle: {italic: false, bold: true, color: '1d6b99'} }, }, bar: {groupWidth: '40%'}, }); print(chart);
ui.Chart.feature.byProperty
সেট-আপের উদাহরণ
ui.Chart.feature.byProperty ফাংশন একটি ডিকশনারি গ্রহণ করে যা আপনাকে
x-অক্ষ বরাবর প্রপার্টির নামের লেবেল এবং ক্রম নিয়ন্ত্রণ করতে দেয়।
এটির জন্য আপনাকে সেগুলিতে সংখ্যাসূচক মান অ্যাসাইন করতে হবে। নিম্নলিখিত কার্টেসিয়ান গ্রিড চার্টগুলি এই বিকল্পটি ব্যবহার করে মাসের লেবেল সেট করে এবং গড় মাসিক বৃষ্টিপাতের জন্য কালানুক্রমিক ক্রমে মাসের নাম সাজায়।
কলাম চার্ট
ফিচারের প্রপার্টি x-অ্যাক্সিস বরাবর প্লট করা হয়, লেবেল করা হয় এবং ডিকশনারি ইনপুট অনুযায়ী সাজানো হয়; প্রদত্ত প্রপার্টির ভ্যালু y-অ্যাক্সিস বরাবর প্লট করা হয়। সিরিজ হল ফিচার, যা কলামের মাধ্যমে দেখানো হয় এবং বেছে নেওয়া প্রপার্টির ভ্যালু দ্বারা
লেবেল করা হয়। বার চার্টে পরিবর্তন করতে,
.setChartType('BarChart') ব্যবহার করুন।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define a dictionary that associates property names with values and labels. var precipInfo = { '01_ppt': {v: 1, f: 'Jan'}, '02_ppt': {v: 2, f: 'Feb'}, '03_ppt': {v: 3, f: 'Mar'}, '04_ppt': {v: 4, f: 'Apr'}, '05_ppt': {v: 5, f: 'May'}, '06_ppt': {v: 6, f: 'Jun'}, '07_ppt': {v: 7, f: 'Jul'}, '08_ppt': {v: 8, f: 'Aug'}, '09_ppt': {v: 9, f: 'Sep'}, '10_ppt': {v: 10, f: 'Oct'}, '11_ppt': {v: 11, f: 'Nov'}, '12_ppt': {v: 12, f: 'Dec'} }; // Organize property information into objects for defining x properties and // their tick labels. var xPropValDict = {}; // Dictionary to codify x-axis property names as values. var xPropLabels = []; // Holds dictionaries that label codified x-axis values. for (var key in precipInfo) { xPropValDict[key] = precipInfo[key].v; xPropLabels.push(precipInfo[key]); } // Define the chart and print it to the console. var chart = ui.Chart.feature .byProperty({ features: ecoregions, xProperties: xPropValDict, seriesProperty: 'label' }) .setChartType('ColumnChart') .setOptions({ title: 'Average Ecoregion Precipitation by Month', hAxis: { title: 'Month', titleTextStyle: {italic: false, bold: true}, ticks: xPropLabels }, vAxis: { title: 'Precipitation (mm)', titleTextStyle: {italic: false, bold: true} }, colors: ['f0af07', '0f8755', '76b349'], }); print(chart);
লাইন চার্ট
ফিচারের প্রপার্টি x-অ্যাক্সিস বরাবর প্লট করা হয়, লেবেল করা হয় এবং ডিকশনারি ইনপুট অনুযায়ী সাজানো হয়; প্রদত্ত প্রপার্টির ভ্যালু y-অ্যাক্সিস বরাবর প্লট করা হয়। সিরিজ হল ফিচার, যা লাইন দ্বারা উপস্থাপিত হয়, বেছে নেওয়া প্রপার্টির ভ্যালু দ্বারা লেবেল করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define a dictionary that associates property names with values and labels. var precipInfo = { '01_ppt': {v: 1, f: 'Jan'}, '02_ppt': {v: 2, f: 'Feb'}, '03_ppt': {v: 3, f: 'Mar'}, '04_ppt': {v: 4, f: 'Apr'}, '05_ppt': {v: 5, f: 'May'}, '06_ppt': {v: 6, f: 'Jun'}, '07_ppt': {v: 7, f: 'Jul'}, '08_ppt': {v: 8, f: 'Aug'}, '09_ppt': {v: 9, f: 'Sep'}, '10_ppt': {v: 10, f: 'Oct'}, '11_ppt': {v: 11, f: 'Nov'}, '12_ppt': {v: 12, f: 'Dec'} }; // Organize property information into objects for defining x properties and // their tick labels. var xPropValDict = {}; // Dictionary to codify x-axis property names as values. var xPropLabels = []; // Holds dictionaries that label codified x-axis values. for (var key in precipInfo) { xPropValDict[key] = precipInfo[key].v; xPropLabels.push(precipInfo[key]); } // Define the chart and print it to the console. var chart = ui.Chart.feature .byProperty({ features: ecoregions, xProperties: xPropValDict, seriesProperty: 'label' }) .setChartType('ScatterChart') .setOptions({ title: 'Average Ecoregion Precipitation by Month', hAxis: { title: 'Month', titleTextStyle: {italic: false, bold: true}, ticks: xPropLabels }, vAxis: { title: 'Precipitation (mm)', titleTextStyle: {italic: false, bold: true} }, colors: ['f0af07', '0f8755', '76b349'], lineSize: 5, pointSize: 0 }); print(chart);
ক্ষেত্র তালিকা
ফিচারের প্রপার্টি x-অ্যাক্সিস বরাবর প্লট করা হয়, লেবেল করা হয় এবং ডিকশনারি ইনপুট অনুযায়ী সাজানো হয়; প্রদত্ত প্রপার্টির ভ্যালু y-অ্যাক্সিস বরাবর প্লট করা হয়। সিরিজ হল ফিচার, যা লাইন এবং শেড করা এলাকার মাধ্যমে দেখানো হয়, বেছে নেওয়া প্রপার্টির ভ্যালু দ্বারা লেবেল করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define a dictionary that associates property names with values and labels. var precipInfo = { '01_ppt': {v: 1, f: 'Jan'}, '02_ppt': {v: 2, f: 'Feb'}, '03_ppt': {v: 3, f: 'Mar'}, '04_ppt': {v: 4, f: 'Apr'}, '05_ppt': {v: 5, f: 'May'}, '06_ppt': {v: 6, f: 'Jun'}, '07_ppt': {v: 7, f: 'Jul'}, '08_ppt': {v: 8, f: 'Aug'}, '09_ppt': {v: 9, f: 'Sep'}, '10_ppt': {v: 10, f: 'Oct'}, '11_ppt': {v: 11, f: 'Nov'}, '12_ppt': {v: 12, f: 'Dec'} }; // Organize property information into objects for defining x properties and // their tick labels. var xPropValDict = {}; // Dictionary to codify x-axis property names as values. var xPropLabels = []; // Holds dictionaries that label codified x-axis values. for (var key in precipInfo) { xPropValDict[key] = precipInfo[key].v; xPropLabels.push(precipInfo[key]); } // Define the chart and print it to the console. var chart = ui.Chart.feature .byProperty({ features: ecoregions, xProperties: xPropValDict, seriesProperty: 'label' }) .setChartType('AreaChart') .setOptions({ title: 'Average Ecoregion Precipitation by Month', hAxis: { title: 'Month', titleTextStyle: {italic: false, bold: true}, ticks: xPropLabels }, vAxis: { title: 'Precipitation (mm)', titleTextStyle: {italic: false, bold: true} }, colors: ['f0af07', '0f8755', '76b349'], lineSize: 5, pointSize: 0, curveType: 'function' }); print(chart);
পাই চার্ট
পাই হল একটি ফিচার, প্রতিটি স্লাইস হল একটি প্রপার্টি লেবেল যার মান পাই তৈরি করা প্রপার্টির সমস্ত মানের যোগফলের শতাংশ হিসাবে কাস্ট করা হয়।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Subset the forest ecoregion feature and select the monthly precipitation // properties, rename them as abbreviated months. var thisForest = ecoregions.filter(ee.Filter.eq('label', 'Forest')) .select(Object.keys(precipInfo), [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]); // Define the chart and print it to the console. var chart = ui.Chart.feature .byProperty({ features: thisForest, xProperties: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] }) .setChartType('PieChart') .setOptions({ title: 'Average Monthly Precipitation for Forest Ecoregion', colors: [ '604791', '1d6b99', '39a8a7', '0f8755', '76b349', 'f0af07', 'e37d05', 'cf513e', '96356f', '724173', '9c4f97', '696969' ] }); print(chart);
ডোনাট চার্ট
pieHole
চার্ট বিকল্প সেট করে পাই চার্টকে ডোনাট চার্টে পরিবর্তন করুন; বেশিরভাগ চার্টে ০.৪ থেকে ০.৬-এর মধ্যে থাকা সংখ্যা সবচেয়ে ভালো দেখাবে।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Subset the forest ecoregion feature and select the monthly precipitation // properties, rename them as abbreviated months. var thisForest = ecoregions.filter(ee.Filter.eq('label', 'Forest')) .select(Object.keys(precipInfo), [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]); // Define the chart and print it to the console. var chart = ui.Chart.feature .byProperty({ features: thisForest, xProperties: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] }) .setChartType('PieChart') .setOptions({ title: 'Average Monthly Precipitation for Forest Ecoregion', colors: [ '604791', '1d6b99', '39a8a7', '0f8755', '76b349', 'f0af07', 'e37d05', 'cf513e', '96356f', '724173', '9c4f97', '696969' ], pieHole: 0.4, }); print(chart);
ui.Chart.feature.groups
কলাম চার্ট
ফিচারগুলি x-অ্যাক্সিস বরাবর প্লট করা হয়, যা একটি নির্বাচিত প্রপার্টির মান দ্বারা লেবেল করা হয়।
প্রদত্ত প্রপার্টির অনন্য মানের সেট দ্বারা সংজ্ঞায়িত কলামের মাধ্যমে সিরিজ উপস্থাপন করা হয়। Y-অক্ষের অবস্থান প্রদত্ত প্রপার্টির মান দ্বারা নির্ধারিত হয়। চার্টের ধরন
'ScatterChart' (.setChartType('ScatterChart')) হিসেবে সেট করে এই প্লটকে স্ক্যাটার প্লটে পরিবর্তন করা যেতে পারে। বিকল্প হিসেবে, সময় যদি
x-অ্যাক্সিস ভেরিয়েবল হয়, তাহলে আপনি লাইন চার্ট ব্যবহার করতে পছন্দ করতে পারেন:
.setChartType('LineChart')।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Import the example feature collection. var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example'); // Define the chart and print it to the console. var chart = ui.Chart.feature .groups({ features: ecoregions, xProperty: 'label', yProperty: '01_tmean', seriesProperty: 'warm' }) .setSeriesNames(['Warm', 'Cold']) .setChartType('ColumnChart') .setOptions({ title: 'Average January Temperature by Ecoregion', hAxis: {title: 'Ecoregion', titleTextStyle: {italic: false, bold: true}}, vAxis: { title: 'Jan temp (°C)', titleTextStyle: {italic: false, bold: true} }, bar: {groupWidth: '80%'}, colors: ['cf513e', '1d6b99'], isStacked: true }); print(chart);
ui.Chart.feature.histogram
বেছে নেওয়া প্রপার্টির ভ্যালুর রেঞ্জের জন্য ভ্যালু বিনের মাধ্যমে x-অ্যাক্সিস সংজ্ঞায়িত করা হয়; প্রদত্ত বিনে এলিমেন্টের সংখ্যা হল y-অ্যাক্সিস।
কোড এডিটর (জাভাস্ক্রিপ্ট)
// Load PRISM climate normals image collection; convert images to bands. var normClim = ee.ImageCollection('OREGONSTATE/PRISM/Norm91m').toBands(); // Make a point sample of climate variables for a region in western USA. var region = ee.Geometry.Rectangle(-123.41, 40.43, -116.38, 45.14); var climSamp = normClim.sample(region, 5000); // Define the chart and print it to the console. var chart = ui.Chart.feature .histogram({features: climSamp, property: '07_ppt', maxBuckets: 30}) .setOptions({ title: 'July Precipitation Distribution for NW USA', hAxis: { title: 'Precipitation (mm)', titleTextStyle: {italic: false, bold: true} }, vAxis: { title: 'Pixel count', titleTextStyle: {italic: false, bold: true} }, colors: ['1d6b99'], legend: {position: 'none'} }); print(chart);