Dashboards elasticharts pie - kwantu/platformconfiguration GitHub Wiki

Pie Chart

Layout

image

Config

image

For pie chart the following config is needed:

——

Pie chart

Node ID: Auto generated Box title : Enter display title Widget: Select 'Elastic Chart' SDO: Select SDO on which the chart will be based Chart type : Select 'Pie' Group by: If taxonomy select the code here. Otherwise put element ID Field: Select which field will be used to calculate the size of the slices Label: Select the field used for the label Function: Select the function used to calculate the size of the slices Chart library : Select which type of chart will be used

The following element IDs can be used from the wrapper data:

        "_seq" : "1",
        "_subprofileId" : "",
        "_workflowDueDate" : "",
        "_workflowStepAssigneeName" : "",
        "_rev" : "",
        "_communityId" : 
        "_profileId" : 
        "_workflowStepId" : "completion",
        "_created" : "",
        "_applicationId" : 
        "_workflowValidDate" : "",
        "_context" : "approved",
        "_workflowStatus" : "Complete",
        "_status" : "Updated",
        "_workflowStepAssignmentDateTime" : "",
        "_workflowStepAssigneeId" : "",
        "_workflowStepComment" : "",
        "_workflowStepName" : "Approved",
        "_rowId" : 
        "_spuuid" : "",
        "_title" :
        "_workflowUUID" : "",
        "_id" : 
        "_workflowStepTransitionDateTime" : "",
        "_workflowStepTransitionId" : "",
        _setId

Rendered Pie chart

image

Datasource call

https://staging.kwantu.net/exist/rest/db/kwantu-resource/api/rest/datasource.xq?communityId=7c8fc6e6-9ac1-47e2-b94b-4ef91bf837ce&setId=performanceQuarterlyDashboard&field=targetsAchievedCount,targetsNotAchieved&type=elasticChart&function=sum&acrossCommunity=

Response

{
    "q": {
        "size": 0,
        "aggs": {
            "targetsNotAchieved2": {
                "sum": {
                    "field": "targetsNotAchieved"
                }
            },
            "targetsAchievedCount1": {
                "sum": {
                    "field": "targetsAchievedCount"
                }
            }
        }
    },
    "result": [
        {
            "targetsNotAchieved": 4,
            "targetsAchievedCount": 4
        }
    ]
}

There will be 2 fields extracted from the response, in this case, targetsNotAchieved and targetsAchievedCount which are rendered in the pie.