DataHubTable Cell Classes

DataHubTable Cell Classes — assign identical arguments to many table cells.

Description

A cell class is a means to assign the same rendering arguments to many different cells. The cell class specifies all of the arguments for a cell except for row, column, label and point name. Consequently, to add a cell that has the same arguments as an existing class, you must only specify those arguments along with the name of the class (see Member of Class - Type 3). A cell class is very convenient if you plan to have many cells using the same rendering. If you decide to change the rendering arguments for those cells, they can all be changed at once by changing the definition of the class. A cell class is also required to provide the rendering arguments for a cell when that cell has a value map. The value map refers to a different cell class for each of the ranges in the value map.

Cell classes are specified similarly to cells. They consist of up to three definitions for rendering, font and value map. If a class contains a value map, then the point value will be used to select a class through the value map. If that class also has a value map, the point value will be used again to select a class from the value map of the referred class. This class reference chain will resolve to an indefinite depth. Be sure not to create classes that refer to one another directly or indirectly through chained value maps. Cell class font specifications are identical to cell font specifications, except that the parameter name is cfont instead of font.

Cell class value map specifications are identical to cell value map specifications, except that the parameter name is cvmap instead of vmap.

A cell class has a type, much like a cell. The cell class can be of type 0 (label), 1 (point) or 4 (image). Label and image types are static. That is, the resulting contents of the cell do not change. In order to modify the contents of a label or image type, you must modify the class of the cell through a value map.

Label (Static Text) - Cell Class Type 0

A label specifies a text string that does not change.

ArgumentTypeDefaultDescription
namestringrequiredThe name of this cell class.
typenumberrequired0 for a label cell.
xalignmentstringleftleft, center or right horizontal alignment of the text in the cell.
yalignmentstringcentertop, center, or bottom vertical alignment of the text in the cell.
fgcolorcolortable defaultThe color used to render the text. If not specified, uses the table's fgcolor parameter.
bgcolorcolortable defaultThe color used to render the cell background. If not specified, uses the table's bgcolor parameter.

Example

<PARAM NAME="class1" VALUE="myclass;0;left;center;#ffff00;#0000ff">
<PARAM NAME="cell1" VALUE="2;3;3;Hello World;myclass">

Will render the words Hello World with left/center justification in yellow text on a blue background.

DataHub Point Value - Cell Class Type 1

This cell will display the value of an DataHub point. If the point value is a number you can specify the decimal format with which it is displayed.

ArgumentTypeDefaultDescription
namestringrequiredThe name of this cell class.
typenumberrequired1 for DataHub point value.
xalignmentstringleftleft, center or right horizontal alignment of the text in the cell.
yalignmentstringcentertop, center or bottom vertical alignment of the text in the cell.
fgcolorcolortable defaultThe color used to render the text. If not specified, uses the table's fgcolor parameter.
bgcolorcolortable defaultThe color used to render the cell background. If not specified, uses the table's bgcolor parameter.
formatstringtable defaultThe decimal format to use when the value of the point is a number

Example

<PARAM NAME="class1" VALUE="myclass;1;left;center;#ffff00;#0000ff">
<PARAM NAME="cell1" VALUE="2;3;3;Sine;myclass">

Will render the value of the point Sine in cell (2, 3) with left/center justification in yellow text on a blue background, with 1 to 3 decimal places of accuracy.

Image - Cell Class Type 4

An image cell renders an image into the cell, clipping the image at the borders of the cell. The image is obtained from a URL.

ArgumentTypeDefaultDescription
namestringrequiredThe name of this cell class.
typenumberrequired4 for Image.
xalignmentstringleftleft, center or right horizontal alignment of the text in the cell.
yalignmentstringcentertop, center or bottom vertical alignment of the text in the cell.
fgcolorcolortable defaultThe color used to render the cell foreground. If not specified, uses the table's fgcolor parameter. Foreground color is unused for image type cells.
bgcolorcolortable defaultThe color used to render the cell background. If not specified, uses the table's bgcolor parameter.
imageurlstringrequiredThe URL from which to obtain the image. This may be either an absolute URL of the form http://domain/path/image, or a relative URL of the form /path/image or path/image.
alphanumber1.0An alpha blend value from 0.0 to 1.0 where 0.0 is transparent and 1.0 is opaque.

Example

<PARAM NAME="class1" VALUE="checkmark;4;center;center;#0;#00000000;checkmark.gif;0.5">
<PARAM NAME="cell1" VALUE="2;3;3;null;checkmark">

Will render the image from the URL checkmark.gif centered in the cell at (2, 3). The image will be semi-transparent. The background of the cell will be transparent.