Class: VisualisationContainer

visuals. VisualisationContainer

A VisualisationContainer attachs to a DOM element and uses the element as a container for drawing data visualisations

The Visualisations supported are pivottable, treemap, and sunburst chart

alt text


new VisualisationContainer()

Methods


draw(dataset)

Draw the visualisation

Parameters:
Name Type Description
dataset DataSet

the Dataset to visualise

Returns:

returns this

Type
VisualisationContainer

setHeight(h)

Sets the height of the visualisation

Parameters:
Name Type Description
h number

height

Returns:

returns this

Type
VisualisationContainer

setOptions(opts)

Sets the options as a JSON object, the object can contain

Parameters:
Name Type Description
opts object

The visualisation options, note Fixed and Hierarchy are treemap and sunburst only


{
"height" : 230,
"width" : 230,
"Fixed" : { "TIME_PERIOD" : "2015" }
"Hierarchy" : ["REF_AREA", "SEX", "AGE"]
}

Returns:

returns this

Type
VisualisationContainer
Example
{
  "height" : 230,
  "width" : 230,
  "Fixed" : {  "TIME_PERIOD" : "2015" }     //Fixes the value of one or more Dimensions   (treemap and sunburst only)
  "Hierarchy" : ["REF_AREA", "SEX", "AGE"]  //Sets the Order to display the dimensions in (treemap and sunburst only)
  "clickObs" : obsClick
}

function obsClick(obs) {
  alert(obs.getValue())
}

setType(type)

Sets the type of visualisation to draw

Parameters:
Name Type Description
type string

defines the visualisation, supported types are: pivottable, treemap, sunburst

Throws:

if the type is not a known type

Type
TypeError
Returns:

returns this

Type
VisualisationContainer

setWidth(h)

Sets the width of the visualisation

Parameters:
Name Type Description
h number

height

Returns:

returns this

Type
VisualisationContainer