# Chart

**Kind:** Class

**Source:** `Pams/Web/Pams.Web/Client/app/models/dashboard/dashboard-data-fields.ts` (line 441)

**Part of:** [Pams](subsystem-pams)

`Chart` represents chart-related field metadata for dashboard data. It stores field names, captions, comparison and storage identifiers, and a hidden state that controls whether the chart is displayed.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `isHidden` | `isHidden()` | `boolean` |
| `setHidden` | `setHidden(flag: boolean)` | `void` |
| `GetStoredName` | `GetStoredName()` | `string` |
| `SetStoredName` | `SetStoredName(name: string)` | `void` |
| `GetComparedFieldName` | `GetComparedFieldName()` | `string` |
| `SetComparedFieldName` | `SetComparedFieldName(name: string)` | `void` |
| `GetFieldName` | `GetFieldName()` | `string` |
| `SetFieldName` | `SetFieldName(name: string)` | `void` |
| `GetCaption` | `GetCaption()` | `string` |
| `SetCaption` | `SetCaption(input: string)` | `void` |
| `SetDataType` | `SetDataType(ty: DataTypeEnum)` | `void` |
| `GetDataType` | `GetDataType()` | `DataTypeEnum` |
| `GetFieldNameAgru` | `GetFieldNameAgru()` | `string` |
| `SetFieldNameAgru` | `SetFieldNameAgru(name: string)` | `void` |
| `GetStoredNameAgru` | `GetStoredNameAgru()` | `string` |
| `SetStoredNameAgru` | `SetStoredNameAgru(name: string)` | `void` |
| `GetTypeAgru` | `GetTypeAgru()` | `DateGroupEnum` |
| `SetTypeAgru` | `SetTypeAgru(dt: DateGroupEnum)` | `void` |

## Where it refuses work

- `Chart` stops the work with an early return when `this.FieldName`.

## Diagram

```mermaid
graph LR
  Dashboard[Dashboard data] --> Chart[Chart]
  Chart --> FieldName[Field name]
  Chart --> Caption[Caption]
  Chart --> StoredName[Stored name]
  Chart --> ComparedFieldName[Compared field name]
  Chart --> Hidden[Hidden state]
```

## Usage

```ts
import { Chart } from "./models/dashboard/dashboard-data-fields";

const chart = new Chart();

chart.SetFieldName("Revenue");
chart.SetCaption("Monthly revenue");
chart.SetStoredName("revenue_monthly");
chart.SetComparedFieldName("PreviousMonthRevenue");

chart.setHidden();

if (!chart.isHidden()) {
  console.log(chart.GetCaption(), chart.GetFieldName());
}
```

## AI Coding Instructions

- Use the `Get...` and `Set...` methods when reading or updating chart metadata instead of accessing backing fields directly.
- Check `isHidden()` before rendering a chart in dashboard UI code.
- Call `setHidden()` only when the chart should no longer be displayed; confirm whether hidden state can be reset elsewhere.
- Keep `FieldName`, `StoredName`, and `ComparedFieldName` aligned with the corresponding dashboard data source fields.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (1)

- `DashboardWidgetOperationsService` — `Pams/Web/Pams.Web/Client/app/services/dashboard/dashboard-widget-operations.service.ts`:1
