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>"
"representationTypeId" : "<representation type ID>",
"parameter" : {
"type" : "parameter"
"dimensions" : [ <dimensions>* ] //optional
"measures" : [ <measures>* ] // optional
"properties" : [ <properties>* ] //optional
"hierarchicalProperty" : [ <hierarchical property> ] //optional
"width" : "<width>"
"alternateRepresentationType" : "TableRepresentation" //optional
"top" : "<number>" //optional
"orderby" : [ <orderby>* ] //optional
}
}
The properties used in the representation
object denote the following:
Property |
Description |
---|---|
|
Unique ID of type string. |
|
ID of the |
|
Defines specific information for the representation, for example, dimensions, measures, properties, the optional alternate table representation, and the column width for table representations. Dimensions, measures, properties and hierarchical property are all optional, but at least one of them must exist, depending on the representation type: Charts have dimensions and measures, tables have properties, and tree tables have a hierarchical property and optionally more properties. At runtime, the constructor defined in the object, which contains a label, an image, and a reference to the constructor function of the representation type |
The properties
property has the following format:
"properties": [
{
"fieldName": "Customer",
"kind": "column",
"fieldDesc": {
"type": "label",
"kind": "text",
"key": "<key>"
}
}
],
The hierarchicalProperty
property has the following format:
"hierarchicalProperty": [
{
"fieldName": "Customer",
"kind": "hierarchicalColumn",
"fieldDesc": {
"type": "label",
"kind": "text",
"key": "<key>"
},
"labelDisplayOption": "text"
}
],
The parameter
property can contain dimensions and measures for the representation.
The dimensions
property has the following format:
* object, which contains a"dimensions" : [
{
"fieldName" : "<field name>",
"kind" : "<value>",
"fieldDesc" : {
"type" : "label",
"kind" : "text",
"key" : "<key>"
},
"labelDisplayOption": "text"
}
]
The kind attribute provides the option to maintain multiple dimensions. It is mapped to feedItemId
. The following table lists the feedItemId
for the available charts:
Chart Type |
Dimension |
feedItemId |
---|---|---|
Line chart, line chart with two vertical axes, column chart, bar chart, stacked column chart, stacked bar chart, 100% stacked column chart, 100% stacked bar chart, combined column line chart, combined stacked column line chart, combined column line chart with two vertical axes, combined stacked column line chart with two vertical axes |
First dimension |
categoryAxis |
Second dimension |
color |
|
Line chart with time axis |
First dimension |
timeAxis |
Second dimension |
color |
|
Heatmap chart |
First dimension |
categoryAxis |
Second dimension |
valueAxis |
|
Pie chart, donut chart |
Dimension |
color |
Scatter chart, bubble chart |
First dimension |
color |
Second dimension |
shape |
The measures
property has the following format:
"measures" : [
{
"fieldName" : "<field name>",
"kind" : "<value>",
"fieldDesc" : {
"type" : "label",
"kind" : "text",
"key" : "<key>"
},
"measureDisplayOption" : "bar"
}
]
The kind attribute provides the option to maintain multiple measures. It is mapped to feedItemId
. The following table lists the feedItemId
for the available charts:
Chart Type |
Measure |
feedItemId |
---|---|---|
Line chart, line chart with time axis, column chart, bar chart, stacked column chart, stacked bar chart, 100% stacked column chart, 100% stacked bar chart, combined column line chart, combined stacked column line chart |
Measure |
valueAxis |
Heatmap chart |
Measure |
Color |
Pie chart, donut chart |
Measure |
size |
Scatter chart, line chart with two vertical axes, combined column line chart with two vertical axes, combined stacked column line chart with two vertical axes |
First measure |
valueAxis |
Second measure |
valueAxis2 |
|
Bubble chart |
First measure |
valueAxis |
Second measure |
valueAxis2 |
|
Third measure |
bubbleWidth |
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" : "tableRepresentation"
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" : <boolean>
}*]