Class pv.Line
Extends
pv.Mark.
Represents a series of connected line segments, or polyline,
that can be stroked with a configurable color and thickness. Each
articulation point in the line corresponds to a datum; for n points,
n-1 connected line segments are drawn. The point is positioned using
the box model. Arbitrary paths are also possible, allowing radar plots and
other custom visualizations.
Like areas, lines can be stroked and filled with arbitrary colors. In most cases, lines are only stroked, but the fill style can be used to construct arbitrary polygons.
See also the Line guide.
Defined in: Line.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pv.Line()
Constructs a new line mark with default properties.
|
Field Attributes | Field Name and Description |
---|---|
Default properties for lines.
|
|
The eccentricity of polar line segments; used in conjunction with
interpolate("polar").
|
|
The line fill style; if non-null, the interior of the line is closed and
filled with the specified color.
|
|
How to interpolate between values.
|
|
The type of corners where two lines meet.
|
|
The width of stroked lines, in pixels; used in conjunction with
strokeStyle to stroke the line.
|
|
Whether the line is segmented; whether variations in stroke style, line width
and the other properties are treated as fixed.
|
|
The style of stroked lines; used in conjunction with lineWidth to
stroke the line.
|
|
The tension of cardinal splines; used in conjunction with
interpolate("cardinal").
|
- Fields borrowed from class pv.Mark:
- bottom, childIndex, cursor, data, events, index, left, parent, proto, reverse, right, root, scale, title, top, type, visible
Method Attributes | Method Name and Description |
---|---|
anchor(name)
Constructs a new line anchor with default properties.
|
This property is fixed. See pv.Mark.
- See:
- pv.color
This property is fixed. See pv.Mark.
For segmented lines, only "miter" joins and "linear" interpolation are currently supported. Any other value, including null, will disable joins, producing disjoint line segments. Note that the miter joins must be computed manually (at least in the current SVG renderer); since this calculation may be expensive and unnecessary for small lines, specifying null can improve performance significantly.
This property is fixed. See pv.Mark.
This property is fixed. See pv.Mark.
- See:
- pv.color
This property is fixed. See pv.Mark.
- top
- left
- center
- bottom
- right
For consistency with the other mark types, the anchor positions are defined in terms of their opposite edge. For example, the top anchor defines the bottom property, such that a bar added to the top anchor grows upward.
- Parameters:
- {string} name
- the anchor name; either a string or a property function.
- Returns:
- {pv.Anchor}