ChartDirector 5.1 (PHP Edition)

JsChartViewer.htmlRect


Usage

htmlRect(w, h, color [, border ])

Description

Generates HTML code that represents an inline color box.

Inline color boxes are useful as legend icons in creating legends dynamically. However, it is not easy to create inline color boxes (boxes that can flow with text similar to a character) that behaves consistently in all browsers.

This method returns an HTML inline color box that is designed to work consistently in all browsers supported by JsChartViewer. Note that to support IE 7 or below, this method requires the file "spacer.gif" to be in the same directory as the Javascript. (The "spacer.gif" is a file included in the ChartDirector distribution. It is a transparent GIF image 1 x 1 pixel in size.) Without this file, the box will always have a grey border in IE 7 or below.

Arguments

ArgumentDefaultDescription
w(Mandatory)The width of the box in pixels.
h(Mandatory)The height of the box in pixels.
color(Mandatory)The color of the box in HTML color format (eg. "#FF0000" or "red")
border""The border style of the box in CSS border property format (eg. "1px solid black").

Return Value

A text string containing HTML that represents an inline color box.