DeviationColumn
- Tim Schauder
- Fynn Grandke (Unlicensed)
Quick Start
Creates a DeviationColumn object that is based on graphomate.ui.tables.AbstractColumn and provides information like the title, width and deviation type. Unlike the DataColumn that describes the values already set by Rows, the DeviationColumn represents a column of calculated values that can be added to a Table. This additional column shows the deviation between a defined base and measure DataColumn.
jQuery.sap.require("graphomate/ui/tables/Table"); jQuery.sap.require("graphomate/ui/enums/DeviationType"); var table = new graphomate.ui.tables.Table({ width: "600px", rows: [ new graphomate.ui.tables.Row({ title: "Monitors", hierarchyLevel: 0, dataPerColumn: [74800000, 65400000] }), new graphomate.ui.tables.Row({ title: "North", hierarchyLevel: 1, dataPerColumn: [15400000, 15000000] }), new graphomate.ui.tables.Row({ title: "South", hierarchyLevel: 1, dataPerColumn: [59400000, 50400000] }), new graphomate.ui.tables.Row({ title: "Tablets", hierarchyLevel: 0, dataPerColumn: [117900000, 108400000] }), new graphomate.ui.tables.Row({ title: "North", hierarchyLevel: 1, dataPerColumn: [70100000, 53900000] }), new graphomate.ui.tables.Row({ title: "South", hierarchyLevel: 1, dataPerColumn: [47800000, 54500000] }) ], columns: [ new graphomate.ui.tables.DataColumn("column-act",{ title: "ACT" }), new graphomate.ui.tables.DataColumn("column-bud",{ title: "BUD" }), new graphomate.ui.tables.DeviationColumn({ type: graphomate.ui.enums.DeviationType.Absolute, title: "\u0394ACT-BUD", baseColumnId: "column-bud", measureColumnId: "column-act" }) ] });
Constructor Details
new graphomate.ui.tables.DeviationColumn(id?:string, settings?:object)
Accepts an id and a settings object or one or none of them. The settings object defines initial property values. Every setting can also be set using the related setter method. The supported settings are all settings inherited from the base class graphomate.ui.tables.AbstractColumn and the following additional ones:
Properties:
- type : graphomate.ui.enums.DeviationType (default: Percent)
- baseColumnId : string (default: "")
- measureColumnId : string (default: "")
Property Details
Each property "sampleProperty" can be set using the related setter "setSampleProperty". Each setter expects a valid value for the related property as input parameter and throws an exception for invalid values. It returns the "this context" for method chaining. Each property "sampleProperty" can also be gotten using the related getter method "getSampleProperty". It expects no input parameters and returns the current value of the related property. Each property that represents or partially contains indices excepts a 0 based index.
The following properties are available:
Property Name | Type | Description |
---|---|---|
type | graphomate.ui.enums.DeviationType | Specifies whether the deviation colum should display an absolute or relative deviation. |
baseColumnId | string | Sets the Id of a DataColum of the same table whose values should be used as a base to calculate the deviation. The base of a deviation is the value that gets subtracted from the measure to calculate the deviation value. |
measureColumnId | string | Sets the Id of a DataColum of the same table whose values should be used as a measure to calculate the deviation. The measure of a deviation is the value from which the base gets subtracted to calculate the deviation value. |
IDs in XML
When using the tables in XML views, the view may manipulate the internal Ids of the graphomate objects by prefixing it with something like 'xmlview1–'. Therefore you can't rely on the local Ids you gave the column objects when referencing them in baseColumnId and measureColumnId. In this case you should use global Ids. You can get them by using the .byId method from the view or the core. Here is a slightly unconvenient but working example of getting the correct global Id from a local one in the controller file to use it with the properties baseColumnId and measureColumnId of a DeviationColumn.
new graphomate.ui.tables.DeviationColumn({ baseColumnId: this.getView().byId("myLocalDataColumnBaseId").getId(), measureColumnId: this.getView().byId("myLocalDataColumnMeasureId").getId(), ... })