ChartDirector 6.0 (Perl Edition)

JsChartViewer.drawHLine


Usage

drawHLine(id, y, x1, x2, lineStyle)

Description

Draws a horizontal 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 drawHLine. 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.
y(Mandatory)The y pixel coordinate of the line, relative to the chart.
x1(Mandatory)The x pixel coordinate of the first end point of the line, relative to the chart.
x2(Mandatory)The x 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.