[Canonical page](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analytics-options/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# AnalyticsOptions

Selects which analytics a [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md>) carries. Set it as the `Analytics` property of [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/solve-options.md>), [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/preview-options.md>) or [`AnalyzeOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analyze-options.md>). Each of those properties defaults to `new AnalyticsOptions()`, which requests nothing.

## Declaration

```csharp
namespace Plen;

public sealed class AnalyticsOptions : IDeepCloneable<AnalyticsOptions>, IEquatable<AnalyticsOptions>
```

## Constructors

### AnalyticsOptions()

```csharp
public AnalyticsOptions()
```

Creates options with both flags `false`.

## Properties

| Property | Type | Default | Description |
|---|---|---|---|
| `Slack` | `bool` | `false` | `true` fills [`Analytics.Slack`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/analytics.md>) with the total and free slack of each task. |
| `CriticalPath` | `bool` | `false` | `true` fills [`Analytics.CriticalPath`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/analytics.md>) with the critical tasks and links. |

With both flags `false`, [`ScheduleResult.Analytics`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/schedule-result.md#analytics>) is `null`. With either flag set, `ScheduleResult.Analytics` is set. Check [`Analytics.Status`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/analytics.md>) before reading its fields.

## Methods

### DeepClone

```csharp
public AnalyticsOptions DeepClone()
```

Returns a copy with the same `Slack` and `CriticalPath`.

### Equals

```csharp
public bool Equals(AnalyticsOptions? other)
```

Value equality: two instances are equal when `Slack` and `CriticalPath` are equal. `GetHashCode` uses the same fields.

### ToString

```csharp
public override string ToString()
```

Returns a debug rendering of the fields, e.g. `AnalyticsOptions { Slack: true, CriticalPath: false }`.

## Example

```csharp
using Plen;

// `project` already holds solved data.
static Analytics? CriticalPathOf(Project project)
{
    var options = new AnalyzeOptions
    {
        Analytics = new AnalyticsOptions { CriticalPath = true, Slack = true },
    };
    return project.Analyze(null, options).Analytics;
}
```

## Related

- [`Analytics`](<https://docs.dhtmlx.com/planning-engine/net/api/core/results/analytics.md>) - the slack and critical path these options fill
- [`AnalyzeOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/analyze-options.md>) - the options of `Project.Analyze` that carry it
- [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/net/api/core/project/solve-options.md>) - the solve options that carry it
- [`Project.Analyze`](<https://docs.dhtmlx.com/planning-engine/net/api/project-analyze.md>) - analytics without rescheduling
- [Critical path and slack](<https://docs.dhtmlx.com/planning-engine/net/scheduling/critical-path-and-slack.md#requesting-analytics>) - requesting and reading analytics
