The representation object defines the relation between the requested data and the representation type, for example, a particular chart type or a list. The format is as follows:
{ "type" : "representation", // optional "id" : <id::string> "representationTypeId" : <representation type ID>, "parameter" : { "type" : "parameter" "dimensions" : [ <dimensions>* ] "measures" : [ <measures>* ] "alternateRepresentationType" : <representation type ID> // optional "width" : <width> //optional "orderby" : [ <orderby>* ] //optional } }
The properties used in the representation object denote the following:
Property |
Description |
---|---|
id |
Unique ID of type string. |
representationTypeId |
ID of the representation type object, which contains a label, an image, and a reference to the constructor function of the representation type. |
parameter |
Defines specific information for the representation, for example, dimensions, measures, the optional alternate representation, and the column width for table representations. At runtime, the constructor defined in the representation type object is called with the parameters defined by this property. |
The parameter property can contain dimensions and measures for the representation.
The dimensions property has the following format:
"dimensions" : [ { "fieldName" : <field name>, "kind" : <value>, "fieldDesc" : { "type" : "label", "kind" : "text", "key" : <key> } } ]
The kind attribute provides the option to maintain multiple dimensions.
If you use VizFrame charts, the kind attribute is mapped to feedItemId. The following table lists the feedItemId for the available charts:
Chart Type |
Dimension |
feedItemId |
---|---|---|
Line chart, column chart, stacked column chart, percentage stacked column chart |
First dimension |
categoryAxis |
Second dimension |
color |
|
Pie chart |
Dimension |
color |
Scatter chart |
First dimension |
color |
Second dimension |
shape |
|
Bubble chart |
First dimension |
color |
Second dimension |
shape |
If you use VIZ charts, supported values for the different chart types are:
Representation Type | Values |
---|---|
Column chart | xAxis, legend |
Bar chart | xAxis, legend |
Stacked column chart | xAxis, legend |
Percentage stacked column chart | xAxis, legend |
Line chart | xAxis, legend |
Pie chart | sectorColor |
Bubble chart | regionColor, regionShape |
Scatter plot chart | regionColor, regionShape |
The measures property has the following format:
"measures" : [ { "fieldName" : <field name>, "kind" : <value>, "fieldDesc" : { "type" : "label", "kind" : "text", "key" : <key> } } ]
The kind attribute provides the option to maintain multiple measures.
If you use VizFrame charts, the kind attribute is mapped to feedItemId. The following table lists the feedItemId for the available charts:
Chart Type |
Measure |
feedItemId |
---|---|---|
Line chart, column chart, stacked column chart, percentage stacked column chart |
Measure |
valueAxis |
Pie chart |
Measure |
size |
Scatter chart |
First measure |
valueAxis |
Second measure |
valueAxis2 |
|
Bubble chart |
First measure |
valueAxis |
Second measure |
valueAxis2 |
|
Third measure |
bubbleWidth | |
Fourth measure |
bubbleHeight |
If you use VIZ charts, supported values for the different representation types are:
Representation Type | Values |
---|---|
Column chart | yAxis |
Bar chart | yAxis |
Stacked column chart | yAxis |
Percentage stacked column chart | yAxis |
Line chart | yAxis |
Pie chart | sectorSize |
Bubble chart | xAxis, yAxis, bubbleWidth, bubbleHeight |
Scatter plot chart | xAxis, yAxis, bubbleWidth, bubbleHeight |
The optional fieldDesc property of the dimensions and measures properties can be used for rendering the axis titles in the chart. For more information, see Rendering of Charts.
For each representation, you can define an alternate representation. A user can switch to the alternate representation directly from any representation without having to access the gallery of available representation types.
To define an alternate representation, the configuration file must contain the following parameter: "alternateRepresentationType" : <representationTypeId>
The property alternateRepresentationType contains a reference to the representation type ID that is configured with details such as the constructor. The constructor of an alternate representation type is handed over to the representation instance using the parameter object.
Using the orderby property, you can define the properties by which the data depicted in the representation is ordered. You can also specify the ordering direction (true = ascending, false = descending).
The orderby property has the following format:
"orderby" : [{ //optional "property" : <property name>, "ascending" : <true | false> }*]