> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/local-governance/access/local-governance-stack/dashboards-and-analytics/dss-configuration-and-setup/building-new-dashboards.md).

# Building New Dashboards

## Overview <a href="#overview" id="overview"></a>

This documentation talks about building a new dashboard in the DSS and also it defines the configurations required for the analytics service. Analytics microservice which is responsible for building, fetching, aggregating, and computing the data on ElasticSearch to a consumable data response. Which shall be later used for visualizations and graphical representations.

## Pre-requisites <a href="#pre-requisites" id="pre-requisites"></a>

Before you proceed with the configuration, make sure the following pre-requisites are met -

* Prior Knowledge of JSON
* Prior Knowledge of Elasticsearch Query Language
* Prior Knowledge of Kibana
* DSS setup

## Key Functionalities

1. Adding new roles for dashboards
2. Adding a new dashboard
3. Adding new visualizations in the existing dashboard
4. Adding new charts for visualizations

## Configuration Details

#### **1. Adding Roles and Dashboards**

* To add a new role, make changes in the RoleDashboardMappingsConf.json (**roles** node) configuration file as below. In the roles array, every JSON object is unique based on the id. The name of the role is defined in the roleName attribute.
* If we want to assign any dashboard to a particular role, add the id and name of the dashboard in the dashboard array. This dashboard id is unique and it’s referred to as the MasterDashboardConfig.json file configuration.

{% hint style="info" %}
Any number of roles & dashboards can be added
{% endhint %}

Below is a sample to add a new role object

![](https://content.gitbook.com/content/OorNqx5By246mkjipsn7/blobs/nlhHw3rdkNWfSg8dwV1d/image-20201021-142505.png)

**2. Adding a new Dashboard**

* To add a new dashboard, make changes in the MasterDashboardConfig.json (**dashboards** node) as below.
* Add the new JSON object in the dashboards array. Add the dashboard name in the name attribute, Id should be unique, which is used for assigning a role for the dashboard. We will talk about visualizations below.

{% hint style="info" %}
Dashboards array add a new dashboard as given below
{% endhint %}

![](https://content.gitbook.com/content/OorNqx5By246mkjipsn7/blobs/fPzgXSBXtRzXNsIy131h/image-20201021-142630.png)

#### **3. Adding new visualizations in the existing dashboard**

* To add new visualizations, make changes again in the MasterDashboardConfig.json (**vizArray** node) as below. Add the visualization name to the name attribute. We will add all the visualizations in the vizArray array. vizArray will contain the name of the visualization, vizType as visual type, noUnit, and charts.
* charts array contains chart API configuration query details. The id is referred to as the chartapiconfig.json file’s key to fetch the required data from elastic search’s index. And the name attribute is referred to as the name of the chart in localization.

![](https://content.gitbook.com/content/OorNqx5By246mkjipsn7/blobs/F2HWfYgkssO5oRPFVCSM/image-20201021-164344.png)

{% hint style="info" %}
vizArray is to hold multiple visualizations
{% endhint %}

#### 4. Adding charts for visualizations

* To add a new chart, chartApiConf.json has to be modified as shown below. A new chartid (key of the JSON) has to be added to the chart node object. The chartid JSON contains the chart name, chart type, valueType, documentType, aggregationPaths and queries attribute.
* Types of the chart: **Metric**, **Pie**, **Line**, **Table,** and **xtable**
* AggregationPaths: Query result will take from this path.
* valueType: Based on the value type result will be shown in the UI. Different types of valueType are **Amount, percentage,** and **number.**
* queries array will contain the information of the module, requestQueryMap (request param of the API), dateRefField (Based on this field date data will be filtered), indexName, and aggrQuery. We can add multiple module queries in a single chart.

![](https://content.gitbook.com/content/OorNqx5By246mkjipsn7/blobs/ePYj4ifIauI1yfS00kso/image-20201021-171351.png)

{% hint style="info" %}
For more information please refer to the reference documents listed below.
{% endhint %}

## Reference Docs <a href="#reference-docs" id="reference-docs"></a>

#### Doc Links <a href="#doc-links" id="doc-links"></a>

| Description                               | Link                                                                                                                                     |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| DSS Backend Configuration Manual          | [DSS Backend Configuration Manual](https://digit-discuss.atlassian.net/wiki/spaces/EPE/pages/117244081/DSS+Backend+Configuration+Manual) |
| DSS Dashboard - Technical Document for UI | <https://digit-discuss.atlassian.net/wiki/spaces/EPE/pages/283017217/DSS+Dashboard+-+Technical+Document+for+UI>                          |
| DSS Technical Documentation               | [DSS Technical Documentation](https://digit-discuss.atlassian.net/wiki/spaces/EPE/pages/118521886/DSS+Technical+Documentation)           |

####

[![Creative Commons License](https://i.creativecommons.org/l/by/4.0/80x15.png)​](http://creativecommons.org/licenses/by/4.0/)All content on this page by [eGov Foundation](https://egov.org.in/) is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digit.org/local-governance/access/local-governance-stack/dashboards-and-analytics/dss-configuration-and-setup/building-new-dashboards.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
