Class Index | File Index

Classes


Class pv.Layout.stack

A layout for stacking marks vertically or horizontally, using the cousin instance. This layout is designed to be used for one of the four positional properties in the box model, and changes behavior depending on the property being evaluated:

If no cousin instance is available (for example, for first instance), the specified offset is used. If no offset is specified, zero is used. For example,
new pv.Panel()
    .width(150).height(150)
  .add(pv.Panel)
    .data([[1, 1.2, 1.7, 1.5, 1.7],
           [.5, 1, .8, 1.1, 1.3],
           [.2, .5, .8, .9, 1]])
  .add(pv.Area)
    .data(function(d) d)
    .bottom(pv.Layout.stack())
    .height(function(d) d * 40)
    .left(function() this.index * 35)
  .root.render();
specifies a vertically-stacked area chart.

Defined in: Stack.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Returns a new stack layout.
Method Summary
Method Attributes Method Name and Description
 
offset(f)
Sets the offset for this stack layout.
Class Detail
pv.Layout.stack()

Returns a new stack layout.

Returns:
{pv.Layout.stack} a stack property function.
See:
pv.Mark#cousin
Method Detail
{pv.Layout.stack} offset(f)

Sets the offset for this stack layout. The offset can either be specified as a function or as a constant. If a function, the function is invoked in the same context as a normal property function: this refers to the mark, and the arguments are the full data stack. By default the offset is zero.

Parameters:
{function} f
offset function, or constant value.
Returns:
{pv.Layout.stack} this.

Documentation generated by JsDoc Toolkit 2.3.0 on Sat Sep 19 2009 10:26:36 GMT-0700 (PDT)