Skip to content

Chart

reference
1 min readUpdated

Kind: Class

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

Part of: 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

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
  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)

  • DashboardWidgetOperationsServicePams/Web/Pams.Web/Client/app/services/dashboard/dashboard-widget-operations.service.ts:1

Was this page helpful?

Download as PDF