# Global time context

Source: https://cumulocity.com/docs/cockpit/global-time-context/
Sector: Application enablement & solutions
Release: Latest

The global time context is the toolbar at the top of dashboards that lets you control the time range, auto-refresh, and data aggregation for all widgets at once. Instead of setting these options in each widget individually, you configure them once, and all compatible widgets update together.

![Global time context toolbar](https://cumulocity.com/docs/images/users-guide/cockpit/cockpit-global-time-context-live-mode.png)

<!--PLACEHOLDER: Screenshot showing the full toolbar with all controls visible: Mode toggle, Time Range dropdown, Auto-refresh toggle, Aggregation options-->


> **Related topics:**
> - [Application enablement & solutions > Cockpit > Working with dashboards](https://cumulocity.com/docs/cockpit/working-with-dashboards/) for details on creating and managing dashboards.
> - [Application enablement & solutions > Cockpit > Widgets collection](https://cumulocity.com/docs/cockpit/widgets-collection/) for details on available widget types.



The toolbar contains the following controls:

| Control      | Description                          |
| :----------- | :----------------------------------- |
| Mode toggle  | Switch between live and history mode |
| Time range   | Select the time period to display    |
| Auto-refresh | Toggle automatic data refresh        |
| Aggregation  | Choose how data points are grouped   |

The toolbar only appears if at least one widget on the dashboard is connected to the global time context. If all widgets are unlinked, a red icon appears in the toolbar indicating that no widgets are synchronized.

![Toolbar with no synced widgets](https://cumulocity.com/docs/images/users-guide/cockpit/cockpit-global-time-context-no-synced-widgets.png)

### Supported widgets {#supported-widgets}

Not all widgets currently support the global time context. Support is being progressively extended to more widgets. Additionally, each widget may support a different set of time context capabilities:

- **Time range** - The widget respects the selected time period
- **Auto-refresh** - The widget refreshes when auto-refresh is enabled
- **Aggregation** - The widget groups data according to the selected aggregation level

### Live mode and history mode {#live-and-history-mode}

The global time context operates in two modes:

**Live mode** shows a rolling time window that moves forward automatically. For example, "Last hour" at 3:00 PM shows 2:00 PM - 3:00 PM. At 3:05 PM, it automatically shows 2:05 PM - 3:05 PM. This mode is suitable for monitoring current status.

![Live mode indicator](https://cumulocity.com/docs/images/users-guide/cockpit/cockpit-global-time-context-live-mode.png)

**History mode** shows a fixed time period. When you select specific dates, the widgets always show that exact period regardless of when you view them. This mode is suitable for analyzing past events.

![History mode indicator](https://cumulocity.com/docs/images/users-guide/cockpit/cockpit-global-time-context-history-mode.png)

### To select a time range {#to-select-time-range}

The time range determines which data is displayed in the widgets.

Available preset options:

| Option      | Description                      |
| :---------- | :------------------------------- |
| Last minute | 60 seconds ago to now            |
| Last hour   | 1 hour ago to now                |
| Last day    | 24 hours ago to now              |
| Last week   | 7 days ago to now                |
| Last month  | Approximately 30 days ago to now |
| Custom      | Selected start date to now       |

In history mode, you can also select a custom time range where you can specify exact start and end dates.

### To enable or disable auto-refresh {#to-enable-disable-auto-refresh}

Auto-refresh periodically reloads data in all widgets. When enabled, most widgets refresh every 5 seconds, while some (such as the "Data point graph" widget) update via realtime connections.

Click the **Auto-refresh** toggle in the toolbar to enable or disable automatic data refresh.


> **Info:**
> In some widgets (such as the "Alarm list" widget), scrolling down unlinks the widget from the global time context. To relink it, scroll back up or click the link button in the widget header.



### To change data aggregation {#to-change-data-aggregation}

Aggregation groups multiple data points into summarized values. This improves performance and readability for large time ranges.

In the **Aggregation** section of the toolbar, select one of the available options:

| Type     | Description                                                              |
| :------- | :----------------------------------------------------------------------- |
| None     | No grouping, shows raw data points                                       |
| Minutely | Groups data into 1-minute intervals                                      |
| Hourly   | Groups data into 1-hour intervals                                        |
| Daily    | Groups data into 1-day intervals                                         |
| Auto     | Calculates the aggregation interval automatically, see [Automatic aggregation](https://cumulocity.com/docs/cockpit/global-time-context/#automatic-aggregation) |


> **Info:**
> Some aggregation options may be disabled if they don't apply to your selected time range. For example, **Daily** aggregation is disabled for ranges less than 1 day.



#### Automatic aggregation {#automatic-aggregation}

With **Auto**, the aggregation interval is calculated automatically from the selected time range and the number of aggregated values you want to see per chart. This keeps charts readable and fast for any time range, without selecting an interval manually.

When **Auto** is selected, the following options appear:

- **Data points per chart** - The number of aggregated values to display per chart (2 - 2000, default 300). The aggregation interval is derived from this value: the larger the time range, the coarser the interval.
- **Keep loading data when zooming in** - When enabled (default), zooming into the chart loads data at a finer interval to keep the set number of data points. When disabled, zooming in reuses the already loaded data without further requests. Zooming out always loads new data.


> **Info:**
> **Auto** is currently supported by the "Data graph" widget only and appears disabled for other widgets. It requires the tenant to use [Enhanced time series support](https://cumulocity.com/docs/standard-tenant/enhanced-time-series-support/).



### To link or unlink a widget {#to-link-unlink-widget}

Widgets can be linked or unlinked from the global time context. When linked, a widget is synchronized and updates automatically when you change the time range, aggregation, or refresh settings. Unlinked widgets operate independently with their own time controls.

#### Using the link icon {#using-the-link-icon}

Look for the link icon in the widget header. Click the icon to toggle between states.

![Linked widget](https://cumulocity.com/docs/images/users-guide/cockpit/cockpit-global-time-context-widget-linked.png)
**Linked** - The widget is synchronized with the global time context.

**Unlinked** - The widget has independent time controls.


> **Info:**
> Unlinking widgets is useful for comparing different time periods side-by-side.



#### Using the widget configuration {#using-the-widget-configuration}

You can also configure the time context in the widget settings. By default, new widgets are connected to the global time context.

In the widget configuration, expand the **Time context** section. Select one of the following options:

**Dashboard** - The widget uses the global time context.

**Widget** - The widget uses its own time settings.
When **Widget** is selected, additional options appear allowing you to configure the widget's own time range, mode, and auto-refresh settings.

![Time context configuration - Widget](https://cumulocity.com/docs/images/users-guide/cockpit/cockpit-global-time-context-widget-config-widget.png)


> **Info:**
> Not all widgets support global time context. Some widgets are configured to operate independently and have their own time picker within the widget. These widgets do not show a link icon.



### URL persistence {#url-persistence}

Your global time context settings are automatically saved in the URL. This allows you to bookmark dashboards with specific time configurations or share links that preserve your selected time range, mode, and aggregation settings.
