Problem to plot dataTable in Google Earth Engine

Viewed 13

In short my main problem is: The data in the table is displayed as [object Object] but I want it to be displayed in the original string format

Detailed: i'm trying to plot a list of results in Google Earth Engine Cosole using the the ui.Chart(dataTable).setChartType('Table'). So to do this i created a 2D array like this (the elements in lists are examples):

var stats_Frost = ee.List(["0.000031", "0.83566", "0.83221", "0.86793"])
var stats_GMap = ee.List(["0.000014", "0.94566", "0.91221", "0.68793"])
var stats_Boxcar = ee.List(["0.000031", "0.84566", "0.84221", "0.84793"])
var stats_Lee = ee.List(["0.000015", "0.89566", "0.88221", "0.75793"])

var dataTable = [
  [
    {label: 'Filter', role: 'domain', type: 'string'},
    {label: 'SSI', role: 'data', type: 'string'},
  ],  
    ['Frost', stats_Frost.get(1)],
    ['Gamma Map', stats_GMap.get(1)],
    ['Boxcar', stats_Boxcar.get(1)],
    ['Lee', stats_Lee.get(1)],
];

The numbers into the lists was obtained by a series of calculus and stored at the list, therefore not direct typed, but its can see the list result in the console print. Like this:

Lists print at the console

So, when i run the code and try to generate the data Table by this code:

// Define the chart and print it to the console.
var chart = ui.Chart(dataTable).setChartType('Table').setOptions({
  title: 'Statistical results of filters'
});
print(chart);

I can't visualize the results as i expected, but they appear that way:

unexpected error in data table

ps.: I was converted the elements of the list for "string type" cause i used format function due the decimal accuracy i want.

That's it, if anyone can help me I will be grateful. Peace!

0 Answers
Related