File

src/app/services/chart/chart.service.ts

Description

A chart diagram service.

Index

Properties
Methods
Accessors

Constructor

constructor(chartColorService: ChartColorService, chartModel: ChartModel, uiService: UiService)

Constructs a chart. ~constructor

Parameters :
Name Type Optional Description
chartColorService ChartColorService No

The chart color service injected dependency.

chartModel ChartModel No

The chart model injected dependency.

uiService UiService No

The ui service injected dependency.

Methods

Public addChart
addChart(frequencies: any[], responsive)

Adds a chart of frequency objects.

Parameters :
Name Type Optional Default value Description
frequencies any[] No

Array of frequency data items for the chart.

responsive No false

Whether the chart is responsive/resizeable.

Returns : DeepPartial<ChartConfiguration>

A ChartConfiguration object.

Public addLanguageChart
addLanguageChart(languages: any[], responsive)

Adds a language chart.

Parameters :
Name Type Optional Default value Description
languages any[] No

The array of languages to show.

responsive No false

Whether the chart is responsive/resizeable.

Returns : DeepPartial<ChartConfiguration>

A ChartConfiguration object.

Protected backgroundColor
backgroundColor(color: string)

The background color.

Parameters :
Name Type Optional Default value Description
color string No '#00000000'

The default background color.

Returns : { backgroundColor: string; hoverBackgroundColor: string; }

A background color object.

Protected borderColor
borderColor(color: string)

The border color.

Parameters :
Name Type Optional Default value Description
color string No '#E8E8E8'

The default border color.

Returns : { borderColor: string; hoverBorderColor: string; }

A border color object.

Public drawChart
drawChart(chartType: string, chartConfiguration: any)

Draws a chart.

Parameters :
Name Type Optional Description
chartType string No

The type of the chart.

chartConfiguration any No

The chart configuration.

Returns : void
Public initColors
initColors()

Initializes the color scheme delegate.

Returns : void
Public refreshCharts
refreshCharts()

Invokes redrawing the charts.

Returns : void
Protected tooltip
tooltip(frequencies?: any[])
Type parameters :
  • TType

The tooltip.

Parameters :
Name Type Optional
frequencies any[] Yes
Returns : DeepPartial<DeepPartial<TooltipOptions<TType>>>

A tooltip object.

Properties

Public Readonly chartModel
Type : ChartModel
The chart model injected dependency.
Public Readonly uiService
Type : UiService
The ui service injected dependency.

Accessors

chartConfiguration
getchartConfiguration()

Adds a chart of frequency objects.

Parameters :
Name Optional Description
frequencies No

Array of frequency data items for the chart.

Returns : DeepPartial<ChartConfiguration>

results matching ""

    No results matching ""