ChartJsWidget class
Extends
Section titled “Extends”- chartDiv
- chartType
- context
- dataColumns
- dataTable
- element
- group
- hasChartTypes
- labelColumn
- potentialDataColumns
- potentialLabelColumns
- settingsDiv
- slot
- supportedChartTypes
- belongsToGroup
- clear
- destroy
- drawChart
- getChartTypeName
- getContext
- getCurrentChartType
- getDataColumnIndex
- getLabelColumnIndex
- getOptions
- getPotentialDataColumns
- getPotentialLabelColumns
- getSupportedChartTypes
- getWidgetType
- hasColumnsForChart
- hasData
- init
- initSettingsDiv
- onProcessEnd
- onProcessStart
- prepareChartData
- refresh
- toggleSettings
- updateSettings
- canDraw
- destroyCore
- drawCore
- initChart
- onProcessEndCore
- onProcessStartCore
- refreshCore
- updateChartColumns
Constructors
Section titled “Constructors”constructor
Section titled “constructor”The default constructor.
⊕ new ChartJsWidget(slot: HTMLElement
): ChartJsWidget
Parameters:
Section titled “Parameters:”- slot:
HTMLElement
- The html element.
Public Properties
Section titled “Public Properties”● id: string
Protected Properties
Section titled “Protected Properties”chartDiv
Section titled “chartDiv”● chartDiv: HTMLElement
chartType
Section titled “chartType”● chartType: ChartType = ChartType.Pie
context
Section titled “context”● context: EqContext
dataColumns
Section titled “dataColumns”● dataColumns: number
[] = []
dataTable
Section titled “dataTable”● dataTable: EasyDataTable
= null
element
Section titled “element”● element: HTMLElement
● group: WidgetGroup
hasChartTypes
Section titled “hasChartTypes”● hasChartTypes: ChartType[] = [ ChartType.Column, ChartType.Bar, ChartType.Line, ChartType.Pie ]
labelColumn
Section titled “labelColumn”● labelColumn: number
= -1
potentialDataColumns
Section titled “potentialDataColumns”● potentialDataColumns: ChartColumn[] = []
potentialLabelColumns
Section titled “potentialLabelColumns”● potentialLabelColumns: ChartColumn[] = []
settingsDiv
Section titled “settingsDiv”● settingsDiv: HTMLElement
● slot: HTMLElement
supportedChartTypes
Section titled “supportedChartTypes”● supportedChartTypes: ChartType[] = []
Protected Accessors
Section titled “Protected Accessors”cssPrefix
Section titled “cssPrefix”⇄ get cssPrefix(): string
Returns string
Public Methods
Section titled “Public Methods”belongsToGroup
Section titled “belongsToGroup”Returns true
if the widget belongs to one of the groups specified in the parameter
▸ belongsToGroup(groups?: WidgetGroup): boolean
Parameters:
Section titled “Parameters:”- groups: WidgetGroup, Optional -
Returns boolean
Clears chart.
▸ clear(): void
Returns void
destroy
Section titled “destroy”▸ destroy(): void
Returns void
drawChart
Section titled “drawChart”Draws chart with delay.
▸ drawChart(delay: number
): void
Parameters:
Section titled “Parameters:”- delay:
number
- The delay.
Returns void
getChartTypeName
Section titled “getChartTypeName”▸ getChartTypeName(ct: ChartType): string
Parameters:
Section titled “Parameters:”- ct: ChartType
Returns string
getContext
Section titled “getContext”Returns current context (the one this widget belongs to)
▸ getContext(): EqContext
Returns EqContext
getCurrentChartType
Section titled “getCurrentChartType”▸ getCurrentChartType(): ChartType
Returns ChartType
getDataColumnIndex
Section titled “getDataColumnIndex”▸ getDataColumnIndex(): number
Returns number
getLabelColumnIndex
Section titled “getLabelColumnIndex”▸ getLabelColumnIndex(): number
Returns number
getOptions
Section titled “getOptions”▸ getOptions(): ChartWidgetOptions
Returns ChartWidgetOptions
getPotentialDataColumns
Section titled “getPotentialDataColumns”▸ getPotentialDataColumns(): ChartColumn[]
Returns ChartColumn[]
getPotentialLabelColumns
Section titled “getPotentialLabelColumns”▸ getPotentialLabelColumns(): ChartColumn[]
Returns ChartColumn[]
getSupportedChartTypes
Section titled “getSupportedChartTypes”▸ getSupportedChartTypes(): ChartType[]
Returns ChartType[]
getWidgetType
Section titled “getWidgetType”▸ getWidgetType(): string
Returns string
hasColumnsForChart
Section titled “hasColumnsForChart”Checks, if there ara colums for chart
▸ hasColumnsForChart(): boolean
Returns boolean
- true
if there are columns, otherwise - false
.
hasData
Section titled “hasData”Checks, if widget has data.
▸ hasData(): boolean
Returns boolean
- true
if has data, otherwise - false
.
Initialize widget.
▸ init(context: EqContext,options?: ChartWidgetOptions): void
Parameters:
Section titled “Parameters:”- context: EqContext - The context.
- options: ChartWidgetOptions, Optional - The options.
Returns void
initSettingsDiv
Section titled “initSettingsDiv”Inititialize settings div.
▸ initSettingsDiv(): void
Returns void
onProcessEnd
Section titled “onProcessEnd”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
onProcessStart
Section titled “onProcessStart”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
prepareChartData
Section titled “prepareChartData”Prepares data for chart.
▸ prepareChartData(): void
Returns void
refresh
Section titled “refresh”Refreshes the widget’s content
▸ refresh(): void
Returns void
toggleSettings
Section titled “toggleSettings”Toggles settings.
▸ toggleSettings(callback?: () => void
): void
Parameters:
Section titled “Parameters:”- callback: () =>
void
, Optional - The callback.
Returns void
updateSettings
Section titled “updateSettings”▸ updateSettings(settings: any
): void
Parameters:
Section titled “Parameters:”- settings:
any
Returns void
Protected Methods
Section titled “Protected Methods”canDraw
Section titled “canDraw”▸ canDraw(): boolean
Returns boolean
destroyCore
Section titled “destroyCore”▸ destroyCore(): void
Returns void
drawCore
Section titled “drawCore”▸ drawCore(): void
Returns void
initChart
Section titled “initChart”▸ initChart(): void
Returns void
onProcessEndCore
Section titled “onProcessEndCore”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
onProcessStartCore
Section titled “onProcessStartCore”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
refreshCore
Section titled “refreshCore”Refresh widget implementation
▸ refreshCore(): void
Returns void
updateChartColumns
Section titled “updateChartColumns”▸ updateChartColumns(): void
Returns void
Static Methods
Section titled “Static Methods”hasChartJs
Section titled “hasChartJs”▸ hasChartJs(): boolean
Returns boolean