HTML Client 5.0.1

Class ChartTable

Object
   |
   +--Table
         |
         +--VisualTable
               |
               +--ChartTable

class ChartTable
extends VisualTable


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

ChartTable(<GroupDescriptor> tGroup, <SchemaDescriptor> tSchema, <String> tSubscriptionMode)

Method Detail

addLine

void addLine(<ChartLine> chartLine,<String> id)

onXOverflow

void onXOverflow(<Number> lastX, <Number> minX, <Number> maxX)

positionXAxis

void positionXAxis(<Number> min, <Number> max)

removeLine

void removeLine(<String> id)

setAreaClass

void setAreaClass(<String> areaClass)

setAreaHeight

void setAreaHeight(<String> height)

setAreaLeft

void setAreaLeft(<String> left)

setAreaTop

void setAreaTop(<String> top)

setAreaWidth

void setAreaWidth(<String> width)

setXAxis

void setXAxis(<FieldDescriptor> field, <boolean> commaAsDecimalSeparator)

setXLabels

void setXLabels(<Number> labelsNum, <String> labelsClass, <LabelFormatter> labelsFormatter)

HTML Client 5.0.1

Lightstreamer HTML Client API
Documentation generated by JSDoc on Tue May 22 11:46:54 2012