require(["esri/tasks/datareviewer/DashboardResult"], function(DashboardResult) { /* code goes here */ });
Description
(Added at v3.14)
Encapsulates data describing a Dashboard Result. This includes arrays that contain unique field values, counts of those field values, and
ReviewerFilters
.
Instances of this class are returned in the deferred object of the
getDashboardResults
operation and in the DashboardTask's
onGetDashboardResultsComplete
event.
Samples
Search for
samples that use this class.
Properties
Methods
Property Details
Array of reviewer result field value counts. Counts are a summary of unique field values in a field.
Name of the reviewer results field. This is the field name used in the
getDashboardResults
function of the DashboardTask class.
Array of reviewer results field values.
An instance of
ReviewerFilters
class. Filters limit or precisely define which dashboard results to generate. You can apply multiple filters to a single request.
Method Details
Gets the result count for a field value.
Parameters:
<String | Number > fieldValue |
Required |
Unique field value from the fieldValues array. |
Sample:
// Converts DashboardResults into an array of key-value pairs to use in a dojo chart.
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
var dashboardTask=new DashboardTask(url);
var deferred=dashboardTask.getDashboardResults("FEATUREOBJECTCLASS");
//Deferred callback and errback function
deferred.then(function(response)
{
var mappedArray=[];
array.forEach(response.dashboardResult.fieldValues, function (item,i)
{
mappedArray.push({
text:"FEATUREOBJECTCLASS " + item,
y:response.dashboardResult.getCount(item)});
});
// now use the mappedArray in the dojo chart addSeries function
}, function(error){
Alert("Error ocurred: " + error.message);
});