ChartDirector 5.1 (PHP Edition)

JsChartViewer.drawVLine


Usage

drawVLine(id, x, y1, y2, lineStyle)

Description

Draws a vertical line on the chart.

The line will be drawn as an HTML element overlaid on top of the chart, with the specified HTML id attribute. The id argument should therefore comply to the HTML standard (eg. begins with A-Z or a-z, followed by letters from A-Z, a-z, 0-9, '-' and '_').

If the id is already used by an existing HTML element, JsChartViewer will assume the element is created earlier by drawVLine. In this case, instead of creating a new HTML element, it will move the existing element to the required position and sets its line style to lineStyle. Recalling this method with different coordinates will have the effect of moving the line around.

The line can be hidden using JsChartViewer.hideObj.

Arguments

ArgumentDefaultDescription
id(Mandatory)The id of the HTML element representing the line.
x(Mandatory)The x pixel coordinate of the line, relative to the chart.
y1(Mandatory)The y pixel coordinate of the first end point of the line, relative to the chart.
y2(Mandatory)The y pixel coordinate of the second end point of the line, relative to the chart.
lineStyle(Mandatory)The line style in CSS border property format (eg. "1px solid black").

Return Value

A DOM element representing the line.