# Dashboards

The following is the Dashboard's Custom Style editor. From here, you can:

1. Set Custom Styles for the **Dashboard**.
2. Set Custom Styles for the **ContextBar**.
3. Set Custom Styles for all of the **Widgets** in the current **Dashboard**, at once.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fb95bbmzLigmrBeRj14oA%2Fimage%20114(1).png?alt=media&#x26;token=f17b726c-fae0-4465-a2d7-b58b1f1d68ad" alt=""><figcaption></figcaption></figure>

### 1. Dashboard customization

Set the `dashboard` properties inside the `dashboard` key

### Available properties:

<table><thead><tr><th width="260">Property</th><th width="240">Accepted values</th><th>Behavior</th></tr></thead><tbody><tr><td><code>color</code></td><td><ul><li>Named colors.</li><li>Hex colors.</li><li>RGB, RGBa</li><li>HSL, HSLa</li></ul></td><td>Sets the color of text and text decorations.</td></tr><tr><td><code>backgroundColor</code></td><td>Any <code>color</code></td><td>Applies solid colors as background on an element.</td></tr></tbody></table>

{% hint style="warning" %}

* Applying any styling to a **Dashboard** will override the settings given by the App's style.
* Any properties' Accepted Values different than numbers, needs to be wrapped up in double quotes as a String.
* The **`ContextBar`**&#x61;nd **`Widget`** components in a **Dashboard** inherit the`color` property from it.
  {% endhint %}

### 2. ContextBar customization: <a href="#h_ba8fc29b1f" id="h_ba8fc29b1f"></a>

Set the `contextBar` properties inside the `contextBar` key

### Available properties: <a href="#h_ba8fc29b1f" id="h_ba8fc29b1f"></a>

| Property                      | Accepted values                                                                                                                                                                                                                                                                                                                 | Behavior                                                 |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| <p><code>title</code><br></p> | <p>A JSON containing the following properties:</p><ul><li><code>fontSize</code></li><li><code>fontFamily</code></li><li><code>fontWeight</code></li></ul>                                                                                                                                                                       | Specifies the properties of the selected title.          |
| `fontSize`                    | <ul><li>Keywords: xx-small, x-small, small, medium, large, x-large, xx-large. </li><li>Length units: mm, cm, in, pt, pc, em, rem, px.</li><li>Percentages.</li></ul>                                                                                                                                                            | Specifies the size, or height, of the font               |
| `boxShadow`                   | <ul><li>Horizontal offset (required): positive or negative number</li><li>Vertical offset (required): positive or negative number</li><li>Blur radius (required): positive number</li><li>Spread radius (optional): positive or negative number</li><li>Color (required): named colors, hex, RGB, RGBA, HSL and HSLA.</li></ul> | Puts shadows on elements                                 |
| `borderRadius`                | Numeric value.                                                                                                                                                                                                                                                                                                                  | Gives any element “rounded corners”                      |
| `fontFamily`                  | <ul><li>Family name.</li><li>Generic family name.</li></ul>                                                                                                                                                                                                                                                                     | Defines the font that is applied to the selected element |
| `backgroundColor`             | Any `color`                                                                                                                                                                                                                                                                                                                     | Applies solid colors as background on an element.        |
| `color`                       | <ul><li>Named colors.</li><li>Hex colors.</li><li>RGB and RGBa colors.</li><li>HSL and HSLa colors.</li></ul>                                                                                                                                                                                                                   | Sets the color of text and text decorations.             |

{% hint style="warning" %}

* Setting the `color` property for the **contextBar** will override its inherited value from the **Dashboard**
* Any properties' Accepted Values different than numbers, needs to be wrapped up in double quotes as a String.
  {% endhint %}

## 3. Widgets customization

Set the `widgets` properties inside the `widgets` key. Go to the **Widgets** section to know what properties can be modified for Widgets.

{% hint style="warning" %}

* This will set the same Custom Style for all the widgets in the dashboard, thus, overriding their individual settings
* Modifying the Custom Style globally will only have effect on the Widgets whose default Custom style hasn't been modified.&#x20;
  {% endhint %}

## Dashboard Custom Style Examples

### **Example 1:** Set the `backgroundColor` property

The following shows how to set background color to "black" for a Dashboard in different ways:

* Named colors:<br>

  ```json
  {
      "dashboard":{
          "backgroundColor" : "black",
          "color": "#f2f2f2",
      },
  }
  ```
* Hex colors:<br>

  <pre class="language-json"><code class="lang-json"><strong>{
  </strong><strong>    "dashboard":{
  </strong><strong>        "backgroundColor" : "#000000",
  </strong>        "color": "#f2f2f2",
      },
  }
  </code></pre>
* RGB:<br>

  <pre class="language-json"><code class="lang-json"><strong>{
  </strong><strong>    "dashboard":{
  </strong><strong>        "backgroundColor" : "rgb(0,0,0)",
  </strong>        "color": "#f2f2f2",
      },
  }
  </code></pre>
* RGBA:<br>

  <pre class="language-json"><code class="lang-json"><strong>{
  </strong><strong>    "dashboard":{
  </strong><strong>        "backgroundColor" : "rgba(0,0,0,1)",
  </strong>        "color": "#f2f2f2",
      },
  }
  </code></pre>
* HSL:<br>

  <pre class="language-json"><code class="lang-json"><strong>{
  </strong><strong>    "dashboard":{
  </strong><strong>        "backgroundColor" : "hsl(0, 0%, 0%)",
  </strong>        "color": "#f2f2f2",
      },
  }

  </code></pre>
* HSLA:<br>

  <pre class="language-json"><code class="lang-json"><strong>{
  </strong><strong>    "dashboard":{
  </strong><strong>        "backgroundColor" : "hsl(0, 0%, 0%, 1)",
  </strong>        "color": "#f2f2f2",
      },
  }

  </code></pre>

The following is the Dashboard before applying the Custom Style:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FID2UnCm2xJGGZyKa5XZR%2Fimage.png?alt=media&#x26;token=ba315ef1-1b41-4098-b46a-5f1954117c2f" alt=""><figcaption></figcaption></figure>

Below is the Dashboard  after applying the Custom Style:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Frc4jQWkA6P381WTKj7Nw%2Fimage.png?alt=media&#x26;token=fa99e68b-2d00-4a31-9c00-c20217342a3f" alt=""><figcaption></figcaption></figure>

### **Example 2:** Inherit the `color` property from Dashboards to all the Widgets in it&#x20;

Lets take a Dashboard containing Widgets with no Custom Style set yet:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FNY90Uff4qBmS2PGFNDJS%2Fimage.png?alt=media&#x26;token=bb0fd6e7-d875-4854-addf-b3400763205f" alt=""><figcaption></figcaption></figure>

Go to the dashboard Custom Style editor and do the following:

1. Delete the `color` property inside the `Widget` key in the Style Editor at the Dashboard level:<br>

   <figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2F5M8ABMUT4KeP4qc6lXYo%2Fimage.png?alt=media&#x26;token=b6a9f3c9-4574-49b9-ba82-310869e90add" alt=""><figcaption></figcaption></figure>
2. Set the Dashboard's `color` property to **red** and save the changes:<br>

   <figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FYEqoOzcQ94cYEVieRZSR%2FGroup%2062448(1).png?alt=media&#x26;token=2ba347aa-b0b2-4d4b-b2a5-9ca878996b02" alt=""><figcaption></figcaption></figure>
3. If you take a look at the Widgets inside the Dashboard, nothing seems to have changed. That is because each widget's individual settings are overriding the `color` property. With that in mind, remove the `color` property from the Widget that you want to inherit this property from the Dashboard.\
   &#x20;

   <figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fr81QM1EOKd77wqwHjX4h%2F3.gif?alt=media&#x26;token=f1477d9f-95f2-4af0-8d75-18b2edc66313" alt=""><figcaption></figcaption></figure>

Note that, once the `color` property of the widget is deleted, it will inherit that property from the Dashboard.

## ContextBar Custom Styles examples

### **Example 1**: Change **ContextBar**'s tittle font and size,  font size and color, and background color

The following is the default Custom Style for every **ContextBar**:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FmtM5JkmguYeQVeXKcgYt%2Fimage.png?alt=media&#x26;token=d328f4ec-d6ca-4e0f-8073-6eb0290b9e8a" alt=""><figcaption></figcaption></figure>

Open the Dashboard Custom Style settings and set the following style for the **ContextBar** in the **Style Editor.** This will change the **ContextBar** background and font color to white and change the font size:

```json
"contextBar": {
        "title": {
            "color": "#000000",
            "fontSize": 14
        },
        "fontSize": 24,
        "backgroundColor": "#ffffff",
        "color": "#000000",
    }
```

The following is the result:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FuzN6gJeMUCyIUOfvRQf1%2Fimage.png?alt=media&#x26;token=2477f3bf-6a0d-4cf9-82b0-53913f98a30a" alt=""><figcaption></figcaption></figure>

## Widgets Custom Styles examples

### **Example 1:** Set a Custom Style for all the Widget in a Dashboard.

By Modifying the elements inside the "widget" key in the Dashboard's Style Editor, you'll be able to apply said style to all the widgets simultaneously on the Dashboard.<br>

Consider the following Dashboard with no Custom Style set yet:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FxfnDii7ZGopFliNT9prf%2Fimage.png?alt=media&#x26;token=0701a11e-8f5f-43b3-a608-7bb6d19a0131" alt=""><figcaption></figcaption></figure>

Suppose that you want to apply the following style for all the widget in the current dashboard at once:

* Set the header font color to white
* Set header border color to black
* Set the header border style to Dotted
* Set the header border width to 1
* Set the header border radius to 10
* Set the header background color to black
* Set the font size to 30
* Set box-shadow to `10px 5px 5px orange`
* Set the border border color to `#5e5e5e`
* Set the border style to solid
* Set border width to 5
* Set border radius to 10
* Set background color to black.<br>

The following is the JSON describing such Custom Style:

```json
"header": {
    "color": "#FFFFFF",
    "borderColor": "#000000",
    "borderStyle": "dotted",
    "borderWidth": 1,
    "borderRadius": 10,
    "backgroundColor": "#000000"
},
"fontSize": 30,
"boxShadow": "10px 5px 5px orange",
"borderColor": "#5e5e5e",
"borderStyle": "solid",
"borderWidth": 5,
"borderRadius": 10,
"backgroundColor": "#000000"


```

In order to apply this Style for all the Widget at once, go to the Dashboard's Style Editor and paste said style in the "widget" key. It will look something like:

```json
{
    "widget": {
         "header": {
            "color": "#FFFFFF",
            "borderColor": "#000000",
            "borderStyle": "dotted",
            "borderWidth": 1,
            "borderRadius": 10,
            "backgroundColor": "#000000"
        },
        "fontSize": 30,
        "boxShadow": "10px 5px 5px orange",
        "borderColor": "#5e5e5e",
        "borderStyle": "solid",
        "borderWidth": 5,
        "borderRadius": 10,
        "backgroundColor": "#000000"
    },
    "dashboard": {
        "color": "#5e5e5e",
        "backgroundColor": "#f2f2f2"
    },
    "contextBar": {
        "color": "#000000",
        "title": {
            "color": "#000000",
            "fontSize": 14
        },
        "fontSize": 24,
        "backgroundColor": "#ffffff"
    }
}
```

Doing so will result in the following:&#x20;

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FFukjO1k9X9I6KbW7guOV%2Fimage.png?alt=media&#x26;token=7a72a4d6-53d7-4730-bb0c-a0af0afdf3d3" alt=""><figcaption></figcaption></figure>

Note that all the Widgets in the current Dashboard got the same Custom Style.
