Class: DataColumnCube

Oracle® JavaScript Extension Toolkit (JET)


oj. DataColumnCube

  • 3.2.0
  • 1.1.0
oj.DataColumnCube Creates an object used to convert rowset data into grouped "cubic" data, where the data values are specified by a single attribute within the rowset (dataValues.labelAttr) and their header values designated by another rowset attribute (dataValues.valueAttr).


new DataColumnCube(rowset, layout, dataValues)

Name Type Description
rowset Array An array of objects containing attribute/value pairs. The entire array or collection will be read to group its attributes according to information given by layout and dataValues
layout Array An array of objects containing two properties: axis - a number representing the number of the axis of the levels; levels - a slowest-to-fastest varying ordered array of objects containing: attribute - an attribute of the rowset objects to assign to this axis and level. If the attribute is the same as that specified by labelAttr, then this level is the data value level
dataValues Object an object containing the following properties: labelAttr - the rowset attribute used to group the data values in the header valueAttr - the rowset attribute used for the actual data values; (optional) defaultAggregation - the default type of oj.CubeAggType to use to aggregate data values where necessary. If the type is 'CUSTOM' then this should be an object with a 'type' property of oj.CubeAggType['CUSTOM'] and a 'callback' property specifying a function to call with each value. The function takes two arguments, the first being the running value for the cell being calculated, the second being the new value to be aggregated with that running value; (optional) aggregation: an array of objects containing: value - the value of labelAttr for which this aggregation should apply; aggregation - the oj.CubeAggType for that value; if aggregation is 'CUSTOM', then a 'callback' property should be added specifying a function (for arguments see above) to call with each value (defaults to sum)