getSpecialValidDimKeys(dimType: PP.Exp.EaxSpecialDimType);
dimType. Special dimension type.
The getSpecialValidDimKeys method returns keys of the specified type of dimensions.
The method returns an Array value.
Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Get name of dimensions that can be used as a timeline:
// Returns dimension names by their keys function getDimensionNames(dimKeys) { var dimensionNames = []; for (var i in expressBox.getSource().getDims()) { var dim = expressBox.getSource().getDims()[i]; if (dimKeys.indexOf(dim.getKey()) !== -1) { dimensionNames.push(dim.getName()); } } return dimensionNames; } // Get key of dimensions that can be used as a dimension scale var dimKeys = expressBox.getSource().getSpecialValidDimKeys(PP.Exp.EaxSpecialDimType.Timeline); console.log("Dimension names can be used as a timeline:\n%s", getDimensionNames(dimKeys).toString());
After executing the example the browser console displays dimension names that can be used as a timeline:
Dimension names that can be used as a timeline:
Data types,Socially economic indicators,Territories,Calendar,Facts
See also: