|
HTML Client 5.0.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Table | +--VisualTable | +--ChartTable
A data table that can be fed with real-time data
delivered by Lightstreamer Server and displayed through a multiline
graphic chart, where some or all of the table fields can be associated
to distinct lines of the chart.
The class contains the subscription details and the event handlers
that allow Lightstreamer to display the real-time data.
In short, each real-time update (i.e. each new row that enters the
logical data table) is associated to an X-coordinate and each field
value in the row can specify the Y-coordinate of a point to be added
to the corresponding line.
To accomplish this, the fields can be associated to chart lines through
addLine(), where the line configuration is also specified.
In addition, one field has to be associated to the X axis and its values
should be generated by a growing source. Note that, in order to create
a chart, the presence of such a growing field is mandatory;
however it may not be a subscribed field: an extra field, to be
synthesized, for instance, from the local time, can be defined and used
as well.
Note that only numeric fields can be associated to chart elements.
If any conversion is needed
in order to read a field value as a number, then an extra field can be
used. Custom management of the chart overflow conditions can be
performed through the provided event handlers.
The multiline chart for the visualization of pushed values is
dynamically maintained by Lightstreamer inside a container HTML element.
The container element can be provided as a DIV or SPAN element owning
the "source='Lightstreamer'" special attribute, together with a "table"
attribute that defines the screen table id. The association to the
data table is made when the data table is brought to the
"running" state, through the identifier supplied
to PushPage.addTable(), that must match the screen table id.
This element is a sort of "macrocell", on which all considerations done
for HTML cells for the generic VisualTable class also apply.
However, VisualTable.setPushedHtmlEnabled() is not meaningful
in this case.
Defined in lspushpage.js
Constructor Summary | |
ChartTable
(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)
Creates an object to be used to describe a data table whose values should be displayed and cumulated into a multiline chart. |
Method Summary | |
void
|
addLine(<ChartLine> chartLine,<String> id)
Operation method that adds a line to a chart. |
void
|
onXOverflow(<Number> lastX, <Number> minX, <Number> maxX)
Event handler that is called when a new update has been received such that one or more points have to be added to the chart lines, but cannot be shown because their X-coordinate value is higher than the upper limit set for the X axis. |
void
|
positionXAxis(<Number> min, <Number> max)
Operation method that sets or changes the limits for the visible part of the X axis of the chart (that is, the minimum and maximum X-coordinates shown in the chart). |
void
|
removeLine(<String> id)
Operation method that removes a line from a chart. |
void
|
setAreaClass(<String> areaClass)
Setter method that sets the stylesheet to be applied to the chart area. |
void
|
setAreaHeight(<String> height)
Setter method that sets the height of the chart area. |
void
|
setAreaLeft(<String> left)
Setter method that sets the distance between the left margin of the chart area and the left margin of the container HTML element. |
void
|
setAreaTop(<String> top)
Setter method that sets the distance between the top margin of the chart area and the top margin of the container HTML element. |
void
|
setAreaWidth(<String> width)
Setter method that sets the width of the chart area. |
void
|
setXAxis(<FieldDescriptor> field, <boolean> commaAsDecimalSeparator)
Setter method that sets the field to be used as the source of the X-coordinate for each update. |
void
|
setXLabels(<Number> labelsNum, <String> labelsClass, <LabelFormatter> labelsFormatter)
Setter method that configures the legend for the X axis. |
Methods inherited from class VisualTable |
setClearOnRemove, setClearOnDisconnected, setClearOnAdd, setPushedHtmlEnabled, isPushedHtmlEnabled, showValues
|
Methods inherited from class Table |
getSchema, getGroup, setDataAdapter, getId, setSelector, setItemsRange, setRequestedMaxFrequency, setRequestedBufferSize, setSnapshotRequired, onItemUpdate, onLostUpdates, onEndOfSnapshot, onStart, getClassName
|
Constructor Detail |
ChartTable(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)
tGroup
- A group descriptor object, which identifies the items that provide the logical data table rows. Usually, the group consists of just one item and the chart lines show the history of all updates for some fields of this item. If the group consists of more than one item, then the same field on different items can be used to generate different lines. However, the same field on both items is used to supply the X-coordinates; this means that the values for this field should be generated by the same growing source for both items. tSchema
- A schema descriptor object, which identifies the fields that represent the chart lines. An Array of field names or a String schema identifier can also be used directly, instead of a schema descriptor object. tSubscriptionMode
- the subscription mode for the items, required by Lightstreamer Server. This kind of data table is suited for MERGE, DISTINCT and RAW modes.
Method Detail |
void addLine(<ChartLine> chartLine,<String> id)
chartLine
- A ChartLine instance, that specifies the configuration properties of the line.
id
- A unique identifier for the line.
void onXOverflow(<Number> lastX, <Number> minX, <Number> maxX)
lastX
- The X-coordinate value of the new points to be shown on the chart and that exceeds the current upper limit.
minX
- The current lower limit for the visible part of the X axis.
maxX
- The current upper limit for the visible part of the X axis.
void positionXAxis(<Number> min, <Number> max)
min
- lower limit for the visible part of the X axis.
max
- higher limit for the visible part of the X axis.
void removeLine(<String> id)
id
- The unique identifier for the line, as was supplied to addLine() when the line was added.
void setAreaClass(<String> areaClass)
areaClass
- the name of an existing stylesheet.
void setAreaHeight(<String> height)
height
- the height in pixels of the chart area.
void setAreaLeft(<String> left)
left
- the width of the left margin of the chart area, in pixels.
void setAreaTop(<String> top)
top
- the height of the top margin of the chart area, in pixels.
void setAreaWidth(<String> width)
width
- the width in pixels of the chart area.
void setXAxis(<FieldDescriptor> field, <boolean> commaAsDecimalSeparator)
field
- a field descriptor object for the X field. A String field name or a Number representing a field position can also be used directly, instead of a field descriptor object.
commaAsDecimalSeparator
- [Optional] true to specify that field values are decimal numbers in which the decimal separator is a comma; false to specify it is a dot. The parameter is optional, with false as its default value.
void setXLabels(<Number> labelsNum, <String> labelsClass, <LabelFormatter> labelsFormatter)
labelsNum
- the number of labels to be spread on the X axis; it should be 1 or greater.
labelsClass
- [Optional] the name of an existing stylesheet, to be applied to the X axis label HTML elements. The parameter is optional; if missing or null, then no specific stylesheet is applied.
labelsFormatter
- [Optional] a LabelFormatter instance, that provides a method to format the X axis values designated for the labels. The parameter is optional; if missing or null, then a default LabelFormatter object is used.
|
HTML Client 5.0.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |