lt.monarch.chart.marker
Class LabelFormatter

java.lang.Object
  extended by lt.monarch.chart.marker.LabelFormatter
All Implemented Interfaces:
java.io.Serializable

public class LabelFormatter
extends java.lang.Object
implements java.io.Serializable

LabelFormatter specifies label format for the marker labels. If the format holds formula or data from data model, then you must specify as following: "You label text $your_formula$ your text again" your_formula - can be any formula, as well as the variable value, just type in x0, x1, x2 and etc. e.g. "$x0$ km/h" In the label you can use index, but it cannot be used in formula, e.g. "Label $index$". The same is with the rows and columns, e.g. "Label $row$,$column$ If you want the expression to display $ symbol, make it double, e.g. "Market $$$$$$" will be displayed as Market $$$.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
LabelFormatter(DataModel model)
          Label formatter constructor.
 
Method Summary
Modifier and Type Method and Description
 java.lang.String format(java.lang.Object expression, int index)
          Formats String or Date according to the model.
 java.lang.String format(java.lang.String expression, int row, int column)
          Formats specified row and column value from the data model
 void setDateFormat(java.lang.String dateFormat)
          Sets date format pattern.
 void setNumberFormat(java.lang.String numberFormat)
          Sets number format pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelFormatter

public LabelFormatter(DataModel model)
Label formatter constructor.

Parameters:
model - data model
Method Detail

format

public java.lang.String format(java.lang.Object expression,
                               int index)
Formats String or Date according to the model.

Parameters:
expression - expression what has to be shown: number, date or formatted formula
index - data model index
Returns:
formated String

format

public java.lang.String format(java.lang.String expression,
                               int row,
                               int column)
Formats specified row and column value from the data model

Parameters:
expression - expression what has to be shown: number,date or formatted formula
row - row of the matrix
column - column of the matrix
Returns:
formatted string

setDateFormat

public void setDateFormat(java.lang.String dateFormat)
Sets date format pattern.

Parameters:
dateFormat - the date format pattern

setNumberFormat

public void setNumberFormat(java.lang.String numberFormat)
Sets number format pattern

Parameters:
numberFormat - number format pattern