FacetCoord

The FacetCoord object contains a set of inner and outer coordinates on which multidimensional data can be represented as nested charts. To create a FacetCoord object, call the FacetCoord constructor:

var rect = new FacetCoord(outerCoord,innerCoord);

You can pass a pair of RectCoord objects (e.g., ‘outerCoord’, ‘innerCoord’, etc.) to the constructor, or specify these later using the inherited FacetCoord.setInnerCoordinates(coord) and FacetCoord.setOuterCoordinate(coord) properties.

The following special methods are provided:

Example

Chart Component Script
dataset = [["State", "City", "Product", "Quantity"],["NJ", "Piscataway", "P1", 200],
["NJ", "Edison", "P2", 100],["NY", "NYC", "P1", 300]]; (1)
graph = new EGraph();
var elem = new IntervalElement("City", "Quantity");
var state = new CategoricalScale("State");
var city = new CategoricalScale("City");
var product = new CategoricalScale("Product");
var quantity = new LinearScale("Quantity");
var inner = new RectCoord(city, quantity); (2)
var outer = new RectCoord(state, product); (2)
var coord = new FacetCoord(outer,inner);  (3)
graph.setCoordinate(coord); (4)
graph.addElement(elem);
1 See dataset to use a data block instead of an array literal.
2 Create the RectCoord objects.
3 Create the FacetCoord from the RectCoord objects.
4 Use EGraph.setCoordinate(coord) to add the Coordinate to the Chart.

FacetCoordExample2

Script that modifies the graph or dataset properties should be placed on the Chart component itself. See Add Component Script for more information. This script has access to the Chart data and Chart API methods. Scripted Charts are not good candidates for user-modification, so you should deselect ‘Enable Ad Hoc Editing’ in the Chart Properties dialog box.