Skip to content

Chart

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.WebApp/Client/app/core/models/dashboard-data-fields.ts (line 434)

Part of: Pams

Chart models dashboard chart field metadata, including field names, stored names, captions, compared field names, and hidden state. Dashboard code reads and updates this metadata when configuring chart display and saved field references.

Methods

MethodSignatureReturns
isHiddenisHidden()boolean
setHiddensetHidden(flag: boolean)void
GetStoredNameGetStoredName()string
SetStoredNameSetStoredName(name: string)void
GetComparedFieldNameGetComparedFieldName()string
SetComparedFieldNameSetComparedFieldName(name: string)void
GetFieldNameGetFieldName()string
SetFieldNameSetFieldName(name: string)void
GetCaptionGetCaption()string
SetCaptionSetCaption(input: string)void
SetDataTypeSetDataType(ty: DataTypeEnum)void
GetDataTypeGetDataType()DataTypeEnum
GetFieldNameAgruGetFieldNameAgru()string
SetFieldNameAgruSetFieldNameAgru(name: string)void
GetStoredNameAgruGetStoredNameAgru()string
SetStoredNameAgruSetStoredNameAgru(name: string)void
GetTypeAgruGetTypeAgru()DateGroupEnum
SetTypeAgruSetTypeAgru(dt: DateGroupEnum)void

Where it refuses work

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

Diagram

mermaid
graph LR
  Chart --> HiddenState[isHidden / setHidden]
  Chart --> StoredName[GetStoredName / SetStoredName]
  Chart --> ComparedField[GetComparedFieldName / SetComparedFieldName]
  Chart --> FieldName[GetFieldName / SetFieldName]
  Chart --> Caption[GetCaption / SetCaption]

Usage

ts
import { Chart } from './core/models/dashboard-data-fields';

const chart = new Chart();

chart.SetStoredName('sales-chart');
chart.SetFieldName('Revenue');
chart.SetComparedFieldName('PreviousRevenue');
chart.SetCaption('Revenue comparison');

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

AI Coding Instructions

  • Keep the existing method casing when calling accessors, such as GetFieldName() and SetCaption().
  • Keep stored names, field names, and compared field names aligned with dashboard field identifiers.
  • Check isHidden() before rendering or adding a chart field to dashboard UI state.
  • Treat setHidden() as a state change and verify its implementation before depending on its repeated-call behavior.

Was this page helpful?

Download as PDF