Reference Source
public class | source

Chart

Direct Subclass:

AxisChart, BubbleChart

Indirect Subclass:

BarChart, LineChart

The Chart object is the parent class for all types of Chart. It is used to initialise all of the base settings universal to all charts.

Constructor Summary

Public Constructor
public

constructor(jConfig: Object, aData: Array, sContainer: String, dContainer: Object)

Constructor function that sets up the local object.

Member Summary

Public Members
public

The chart's data

public

SVG d3 object for d3 operations on the chart

public

DOM reference to container element that wraps SVG

public

DOM reference to loader display element

public

SVG DOM object for displaying the chart

public

The current calculated height of the chart

public

The width before any browser resize

public

The current calculated inner height of the chart

public

The current calculated inner width of the chart

public
public

Default time for d3 transitions on the chart

public

The current calculated width of the chart

public

The chart's config object

public

The padding for the chart within the container

public
public
public

Chart's tooltip object

Method Summary

Public Methods
public

init(): *

Check chart is ready and render.

public

setConfig(jConfig: Object)

Sets the local config options for the chart.

public

setContainer(dContainer: Object)

Sets the local container object.

public

setData(aData: Array, bTransform: Boolean)

Sets the local data for the chart.

public

Sets the local chart dimensions based on the size of the container.

public

updateConfig(jConfig: JSON)

Updates the local config for the chart.

public

updateData(aData: Array, bTransform: Boolean)

Updates the local data for the chart.

Public Constructors

public constructor(jConfig: Object, aData: Array, sContainer: String, dContainer: Object) source

Constructor function that sets up the local object.

Params:

NameTypeAttributeDescription
jConfig Object

JSON configuration object

aData Array

the data to be displayed

sContainer String

Optional ID to select DOM object

dContainer Object

Optional DOM object in place of ID

Public Members

public aData: Array source

The chart's data

Properties:

NameTypeAttributeDescription
aData *

public d3Svg: Object source

SVG d3 object for d3 operations on the chart

Properties:

NameTypeAttributeDescription
d3Svg *

public dContainer: Object source

DOM reference to container element that wraps SVG

Properties:

NameTypeAttributeDescription
dContainer *

public dLoader: Object source

DOM reference to loader display element

Properties:

NameTypeAttributeDescription
dLoader *

public dSvg: Object source

SVG DOM object for displaying the chart

Properties:

NameTypeAttributeDescription
dSvg *

public iHeight: Number source

The current calculated height of the chart

Properties:

NameTypeAttributeDescription
iHeight *

public iInitialWidth: Number source

The width before any browser resize

Properties:

NameTypeAttributeDescription
iInitialWidth *

public iInnerHeight: Number source

The current calculated inner height of the chart

Properties:

NameTypeAttributeDescription
iInnerHeight *

public iInnerWidth: Number source

The current calculated inner width of the chart

Properties:

NameTypeAttributeDescription
iInnerWidth *

public iResizeOffset: * source

public iTransitionTime: Number source

Default time for d3 transitions on the chart

Properties:

NameTypeAttributeDescription
iTransitionTime *

public iWidth: Number source

The current calculated width of the chart

Properties:

NameTypeAttributeDescription
iWidth *

public jConfig: Object source

The chart's config object

Properties:

NameTypeAttributeDescription
jConfig *

public jPadding: Object source

The padding for the chart within the container

Properties:

NameTypeAttributeDescription
jPadding *

public oChartOutWatcher: * source

public oResizeWatcher: * source

public oTooltip: Object source

Chart's tooltip object

Properties:

NameTypeAttributeDescription
oTooltip *

Public Methods

public init(): * source

Check chart is ready and render.

Return:

*

Throw:

Error

chart not ready for initialisation

public setConfig(jConfig: Object) source

Sets the local config options for the chart.

Params:

NameTypeAttributeDescription
jConfig Object

JSON configuration object

Throw:

Error

missing configuration

public setContainer(dContainer: Object) source

Sets the local container object.

Params:

NameTypeAttributeDescription
dContainer Object

Required DOM element

Throw:

Error

invalid DOM element

public setData(aData: Array, bTransform: Boolean) source

Sets the local data for the chart.

Params:

NameTypeAttributeDescription
aData Array

array of JSON objects

bTransform Boolean

transform mapped data

Throw:

Error

missing data

public setDimensions() source

Sets the local chart dimensions based on the size of the container.

Throw:

Error

missing DOM element

public updateConfig(jConfig: JSON) source

Updates the local config for the chart.

Params:

NameTypeAttributeDescription
jConfig JSON

config JSON style object

public updateData(aData: Array, bTransform: Boolean) source

Updates the local data for the chart.

Params:

NameTypeAttributeDescription
aData Array

array of JSON objects

bTransform Boolean

transform mapped data