Web Client 8.0.2



Object that describes a single line of a multi-line chart. Instances of this class are automatically generated by a Chart instance based on the Chart#setXAxis and Chart#addYAxis configurations and can be customized during the ChartListener#onNewLine event.


new ChartLine()

Used by Lightstreamer to provide a ChartLine object to each call of the ChartListener#onNewLine event. This constructor is not supposed to be used by custom code.


getYField() → {Number}

Inquiry method that retrieves the field in the Chart internal model representing the Y axis to which this ChartLine pertains.


the field representing the Y axis.


positionYAxis(min, max)

Operation method that sets or changes the limits for the visible part of the Y axis of the chart (that is, the minimum and maximum Y-coordinates shown in the chart for this line). When these limits are changed a full repaint of the line is performed.

Lifecycle: The Y axis limits can be set at any time.

Name Type Description
min Number

lower limit for the visible part of the Y axis.

max Number

higher limit for the visible part of the Y axis.


if the min parameter is greater than the max one.


setStyle(pointColoropt, lineColoropt, pointSizeopt, lineSizeopt)

Setter method that sets the style to be applied to the points drawn on the chart area. Colors of the points, and lines can be customized using valid CSS colors while size is specified in pixels.

Name Type Attributes Default Description
pointColor String <optional>

color use to draw the points on the chart. A point is drawn per each new value in the model. Any valid CSS color can be used. By default "black" is used.

lineColor String <optional>

the color use to draw the lines on the chart. A line is to connect two consecutive points for the same line. Any valid CSS color can be used. By default "black" is used.

pointSize Number <optional>

the size in pixel of the drawn points. By default 1 is used.

lineSize Number <optional>

the size in pixel of the drawn lines. By default 1 is used.


if pointSize or lineSize are not valid positive integer numbers.


setYLabels(labelsNum, labelsClassopt, labelsFormatteropt)

Setter method that configures the legend for the Y axis. The legend consists of a specified number of labels for the values in the Y axis. The labels values are determined based on the axis limits; the labels appearance is controlled by supplying a stylesheet and a formatter function.
Note that the room for the Y axis labels on the page is not provided by the library; it should be provided by specifying a chart width smaller then the container element width and displaced on the right, through the Chart#configureArea setting. Moreover, as the upmost and lowest labels are centered on the chart area borders, a little space should be provided also over and under the chart area, through the same method.

Lifecycle: Labels can be configured at any time. If not set, no labels are displayed relative to the Y axis. If set for different ChartLine instances on the same Chart then more sets of labels will be printed.

Name Type Attributes Description
labelsNum Number

the number of labels to be spread on the Y axis; it should be 1 or greater.

labelsClass String <optional>

the name of an existing stylesheet, to be applied to the Y axis label HTML elements. The parameter is optional; if missing or null, then no specific stylesheet is applied.

labelsFormatter LabelsFormatter <optional>

a Function instance used to format the Y axis values designated for the labels.
The function will be invoked with a Number argument and should return a String. If the function is not supplied, then the value will be used with no further formatting.


if labelsNum is not a valid positive integer number.