GLG Toolkit, JavaScript Library  Version 4.6
GlgLabelFormatter Interface Reference

Label formatter interface. More...

Detailed Description

Label formatter interface.

A label formatter is used to supply custom labels for chart axes and is installed via SetLabelFormatter.

The GetString method defines the type signature of the function that needs to be passed as a parameter of the SetLabelFormatter method to add a label formatter.

Public Member Functions

String GetString (GlgObject axis, GlgLabelType label_type, GlgValueType value_type, double value, long sec, double fractional_sec, Object reserved)
 Label formatting method. More...
 

Member Function Documentation

◆ GetString()

String GetString ( GlgObject  axis,
GlgLabelType  label_type,
GlgValueType  value_type,
double  value,
long  sec,
double  fractional_sec,
Object  reserved 
)

Label formatting method.

This method is invoked every time a new label string needs to be generated. It can create and return a label string, or return null to use a default label string.

Parameters
axisThe label's axis object.
label_typeThe type of the label: TICK_LABEL_TYPE or SELECTION_LABEL_TYPE.
value_typeThe type of the axis' value: NUMERICAL_VALUE or TIME_VALUE.
valueThe value corresponding to the label position.
secAn integer number of seconds since the Epoch corresponding to the label position for TIME_VALUE axes.
fractional_secThe fractional number of seconds for TIME_VALUE axes.
reservedReserved parameter
Returns
A custom label string, or null to use the default label format.