> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Baselines Parameters

> Nextedy GANTT supports baseline comparison to visualize the difference between the current schedule and a historical schedule snapshot.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Baselines Widget Parameters

| Name              | Type    | Default | Description                                                                                                                                                              |
| ----------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Show Baselines`  | Boolean | `false` | When enabled, the Gantt automatically loads and displays baseline data on every page load using the configured `Compare to date` value.                                  |
| `Compare to date` | String  | Empty   | The default comparison reference point. Accepts a relative date (T-minus), a specific date, or a page parameter reference. Only visible when `Show Baselines` is `true`. |

<Warning title="Parameter Dependency">
  The `Compare to date` parameter only appears in the widget parameter editor after you set **Show Baselines** to `Yes`.
</Warning>

## Comparison Modes

The Gantt supports three methods for comparing the current schedule against a historical snapshot:

| Mode           | Description                                                                                               | Available Since |
| -------------- | --------------------------------------------------------------------------------------------------------- | --------------- |
| Specific date  | Select a calendar date to compare against. The Gantt loads task positions as of that date.                | Version 1.5     |
| Named baseline | Select a named Polarion baseline from a dropdown. The baseline revision provides the historical snapshot. | Version 2.4.0   |
| SVN revision   | Enter a specific SVN revision number. The system validates the revision exists before applying.           | Version 25.3.0  |

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/umKaPvHwUHw-ZQFM/gantt/diagrams/reference/widget-parameters/baselines/diagram-1.svg?fit=max&auto=format&n=umKaPvHwUHw-ZQFM&q=85&s=ce12700a9895736fbe5b80a3327ec733" alt="diagram" style={{ maxWidth: "880px", width: "100%" }} width="880" height="250" data-path="gantt/diagrams/reference/widget-parameters/baselines/diagram-1.svg" />
</Frame>

## Automatic vs. One-Time Comparison

**Automatic comparison** (`Show Baselines` = `Yes`): The Gantt loads baseline data on every page render using the `Compare to date` value. Baseline bars are always visible.

**One-time comparison** (toolbar button): Click the **Compare with History** toolbar button to open a dialog where you select the comparison mode and reference point. The comparison persists until you close it or navigate away.

<Note title="One-Time Overrides Automatic">
  When `Show Baselines` is configured but the user triggers a one-time comparison with a different date, the one-time comparison takes precedence and refreshes the baseline display.
</Note>

## Compare to Date Formats

The `Compare to date` widget parameter accepts the following formats:

| Format             | Example      | Description                                                                       |
| ------------------ | ------------ | --------------------------------------------------------------------------------- |
| Relative (T-minus) | `T-30`       | Compare against the schedule 30 days ago.                                         |
| Specific date      | `2024-01-15` | Compare against a fixed historical date.                                          |
| Page parameter     | `$pageParam` | Use a Polarion page parameter value, allowing users to pick the date dynamically. |

## NEW Badge for Added Tasks

Since version **25.3.0**, tasks created after the selected comparison point are marked with a **NEW** badge. This helps you identify work items that were added to the schedule after the baseline was taken.

## Baseline Data Fields

When baseline comparison is active, the Gantt data response includes two additional fields per task:

| Field                | Type   | Description                                                           |
| -------------------- | ------ | --------------------------------------------------------------------- |
| `planned_start_date` | Date   | The start date of the task as of the comparison date.                 |
| `planned_duration`   | Number | The duration (in working days) of the task as of the comparison date. |

These fields drive the secondary baseline bar rendered below each current task bar.

## Baseline API

Named baselines are fetched from the Polarion server via the baselines API endpoint. Each baseline record contains:

| Field        | Type   | Description                                           |
| ------------ | ------ | ----------------------------------------------------- |
| `revisionId` | String | The SVN revision number associated with the baseline. |
| `name`       | String | The user-defined name of the baseline.                |
| `created`    | Date   | The creation timestamp of the baseline.               |

## Pre-Conditions

* **Unsaved changes:** The Compare with History dialog cannot be opened when the Gantt has unsaved edits. Save or discard changes before comparing.
* **Read-only mode:** Baseline comparison is fully available in read-only mode.

## Item Script Approach

For item-specific baselines (instead of a single historical date), use the [Item Script API](/gantt/reference/api/item-script-api) to set planned dates per item:

```javascript theme={null}
task.planned_start_date = util.getDate(wi, "gantt_initial_start");
task.planned_duration = util.getDuration(wi, "gantt_initial_duration");
```

This compares each item against its own saved initial schedule rather than a single global date.

## Configuration Example

To show automatic baseline comparison against a date 30 days ago:

1. Open **Widget Properties** for the Gantt widget.
2. In the **Baselines** section:
   * Set **Show Baselines** to `Yes`.
   * Set **Compare to date** to `T-30`.
3. Save the widget parameters.

The Gantt chart now displays baseline bars on every load, comparing the current schedule against the state 30 days prior.

## Related Pages

* [Work Items Gantt Widget Parameters](/gantt/reference/widget-parameters/work-items-gantt) -- main widget parameters
* [Item Script API](/gantt/reference/api/item-script-api) -- per-item baseline scripting
* [Toolbar Actions and Keyboard Shortcuts](/gantt/reference/keyboard-shortcuts) -- Compare with History toolbar button

<LastReviewed date="2026-07-02" />
