National Dashboard Service Configuration

Recently Added Properties in ChartApiConfig

Todays Collection

Possible Values: true/false

Supported Chart Types: METRIC

How it Works: This property is added to support the new requirement to show the Date and the last updated time in the Todays Collection Metric Chart

Populating true for isTodaysCollection for any chart config in chartApiConfig.json of type metric chart, MetricChartResponseHandler looks for todaysDate and lastUpdatedTime aggregations with the bucket(s) having epoch in key. These are used as values for todaysDate and lastUpdatedTime respectively and added to plots in the response. The UI framework is used to show the Collection 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

Possible Values: Map the key as one of the aggregationPaths and value as compute Helper

For instance -

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

Supported Chart Types: METRIC

How it Works: Metric Chart Type has the action property. Possible values include percentage or undefined. On Collecting the aggregationPath values -

  • the percentage is calculated if the action is a percentage

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

For TargetAchievement there is a requirement to apply repsonseToDifferenceOfDates compute helper on one of the aggregation path values before applying action.

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

According to the above example, responseToDifferenceOfDate Compute helper is applied to the value of the Actual Collection aggregation before applying percentage calculation on all aggregation values. National Dashboard UI Tech Documentation:

National Dashboard - UI Technical Documentation

Last updated

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.