National Dashboard Technical Documentation

Newly Introduced Properties in ChartApiConfig

TodaysCollection

Posssible Vaues: true/false

Supported Chart Types: METRIC

How it Works :

This propperty is added to support the new Requirement to show the Date and the lastUpdated time in the Todays Collection Metric Chart

 

on populating true for isTodaysCollection for a any chart config in chartApiConfig.json of type metric chart, MetricChartResponseHandler would look for todaysDate and lastUpdatedTime aggregations with the bucket(s) having epoch in key. Which will be used as values for todaysDate and lastUpdatedTime respectively and added to plots in the responnse. Which will be used by UI framework to show the Colection on Date and lastupdate time tooltip.

Sample Response

 

"aggregations" : { "AGGR" : { "meta" : { }, "doc_count" : 256, "todaysDate" : { "doc_count_error_upper_bound" : 0, "sum_other_doc_count" : 240, "buckets" : [ { "key" : 1645747200000, "key_as_string" : "25-02-2022 00:00:00", "doc_count" : 16, "Todays Collection" : { "value" : 135.0 } } ] }, "lastUpdatedTime" : { "doc_count_error_upper_bound" : 0, "sum_other_doc_count" : 16, "buckets" : [ { "key" : 1646316682170, "doc_count" : 16 } ] } } }

Sample Query

 

{ "aggs": { "AGGR": { "filter": { "bool": {} }, "aggs": { "todaysDate": { "terms": { "field": "date", "order": { "_term": "desc" }, "size": 1 }, "aggs": { "Todays Collection": { "sum": { "field": "todaysCollectionForPaymentMode" } } } }, "lastUpdatedTime": { "terms": { "field": "lastModifiedTime", "order": { "_term": "desc" }, "size": 1 } } } } } }

 

preActionTheory

Posssible Vaues: Map with the key as one of the aggregationPaths and value as compute Helper

Ex:

"preActionTheory":{ "Actual collection":"repsonseToDifferenceOfDates" }

Supported Chart Types: METRIC

How it Works :

Metric Chart Type has the action property, possible values are percentage or undefined. On Collecting the aggregationPath values

  • percentage will be calcuated if the action is percentage

  • all aggregation values are summed up if the action is undefined

for TargetAchievement there was a requirement to apply repsonseToDifferenceOfDates compute helper on the one of the aggregation path value before applying action.

The preaction theory helps to apply compute helper before actually applyin the action.

According to the above example, responseToDifferenceOfDate Compute helper will be applied on the value of the Actual Collection aggregation before apply percentage calculation on all aggregation values.

National Dashboard UI Tech Documentation
https://digit-discuss.atlassian.net/wiki/spaces/DD/pages/2072018947