# Dashboards & Analytics Service Configuration

### Recently Added Properties in ChartApiConfig  <a href="#newly-introduced-properties-in-chartapiconfig" id="newly-introduced-properties-in-chartapiconfig"></a>

#### Todays Collection <a href="#todayscollection" id="todayscollection"></a>

**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

&#x20;![](/files/x0rKPqkrCuqiqztCDgWD)

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
          }
        ]
      }
    }
  }
```

&#x20;**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 <a href="#preactiontheory" id="preactiontheory"></a>

**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:**&#x20;

[National Dashboard - UI Technical Documentation](/local-governance/access/local-governance-stack/dashboards-and-analytics/dashboards-and-analytics-service-configuration/dashboards-ui-configuration.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digit.org/local-governance/access/local-governance-stack/dashboards-and-analytics/dashboards-and-analytics-service-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
