ChartDirector Ver 4.1 (ColdFusion Edition)

XYChart.addVectorLayer


Usage

addVectorLayer(xData, yData, lengths, directions [, lengthScale [, color [, name ]]])

Description

Adds a vector layer to the chart.

The vectors are specified as 4 data series, representing the x and y coordinates of the reference points to put the vectors, and the lengths and directions of the vectors.

By default, the vector starts from the reference point and points away from it. You may use VectorLayer.setArrowAlignment to specify other options, such as for the vectors to point into the reference point, or to have the reference as a pivot at the mid-point of the vector.

ChartDirector supports specifying vectors lengths as pixels or in axis scale. The unit is specified by using the following predefined constants.

ConstantValueDescription
PixelScale0The unit is measured in pixels.
XAxisScale1The unit is measured in x-axis scale.
YAxisScale2The unit is measured in y-axis scale.

Arguments

ArgumentDefaultDescription
xData(Mandatory)An array of numbers representing the x coordinates for the reference points of the vectors.
yData(Mandatory)An array of numbers representing the y coordinates for the reference points of the vectors.
lengths(Mandatory)An array of numbers representing the lengths of the vectors, in unit as specified in the lengthScale argument.
directions(Mandatory)An array of numbers representing the direction of the vectors as a clockwise angle in degrees, where 0 is upward pointing direction.
lengthScalePixelScaleThe unit for the lengths, which must be one of the predefined constants in the table above.
color-1The color to draw the data points. -1 means that the color is automatically selected from the palette.
name""The name of the layer. The name will be used in the legend box, if one is available. An empty string means the layer has no name.

Return Value

A VectorLayer object representing the vector layer created.