Skip to content

ChartWidget class

Widget


The default constructor. ⊕ new ChartWidget(slot: HTMLElement): ChartWidget

  • slot: HTMLElement - The html element.


● id: string



● chartDiv: HTMLElement


● chartType: ChartType = ChartType.Pie


● context: EqContext


● dataColumns: number[] = []


● dataTable: EasyDataTable = null


● element: HTMLElement


● group: WidgetGroup


● hasChartTypes: ChartType[]


● labelColumn: number = -1


● potentialDataColumns: ChartColumn[] = []


● potentialLabelColumns: ChartColumn[] = []


● settingsDiv: HTMLElement


● slot: HTMLElement


● supportedChartTypes: ChartType[] = []



⇄ get cssPrefix(): string

Returns string



Returns true if the widget belongs to one of the groups specified in the parameter

▸ belongsToGroup(groups?: WidgetGroup): boolean

Returns boolean


Clears chart.

▸ clear(): void

Returns void


▸ destroy(): void

Returns void


Draws chart with delay.

▸ drawChart(delay: number): void

  • delay: number - The delay.

Returns void


▸ getChartTypeName(ct: ChartType): string

Returns string


Returns current context (the one this widget belongs to)

▸ getContext(): EqContext

Returns EqContext


▸ getCurrentChartType(): ChartType

Returns ChartType


▸ getDataColumnIndex(): number

Returns number


▸ getLabelColumnIndex(): number

Returns number


▸ getOptions(): ChartWidgetOptions

Returns ChartWidgetOptions


▸ getPotentialDataColumns(): ChartColumn[]

Returns ChartColumn[]


▸ getPotentialLabelColumns(): ChartColumn[]

Returns ChartColumn[]


▸ getSupportedChartTypes(): ChartType[]

Returns ChartType[]


▸ getWidgetType(): string

Returns string


Checks, if there ara colums for chart

▸ hasColumnsForChart(): boolean

Returns boolean - true if there are columns, otherwise - false.


Checks, if widget has data.

▸ hasData(): boolean

Returns boolean - true if has data, otherwise - false.


Initialize widget.

▸ init(context: EqContext,options?: ChartWidgetOptions): void

Returns void


Inititialize settings div.

▸ initSettingsDiv(): void

Returns void


This function is called on the end of some process this widget participates in. For example, some widgets should be updated on model loading or after the execution of the current query

▸ onProcessEnd(): void

Returns void


This function is called on the start of some process this widget participates in. For example, some widgets can show a spinner or a progress bar at the beginning of some long process (e.g. model loading).

▸ onProcessStart(): void

Returns void


Prepares data for chart.

▸ prepareChartData(): void

Returns void


Refreshes the widget’s content

▸ refresh(): void

Returns void


Toggles settings.

▸ toggleSettings(callback?: () => void): void

  • callback: () => void, Optional - The callback.

Returns void


▸ updateSettings(settings: any): void

  • settings: any

Returns void



▸ canDraw(): boolean

Returns boolean


▸ destroyCore(): void

Returns void


▸ drawCore(): any

Returns any


▸ initChart(): any

Returns any


This function is called from onProcessEnd function. It does nothing in the base Widget class but can be overridden in derived classes to implement the functionality specific for a particular widget.

▸ onProcessEndCore(): void

Returns void


This function is called from onProcessStart function. It does nothing in the base Widget class but can be overridden in derived classes to implement the functionality specific for a particular widget.

▸ onProcessStartCore(): void

Returns void


Refresh widget implementation

▸ refreshCore(): void

Returns void


▸ updateChartColumns(): any

Returns any