org.moxieapps.gwt.highcharts.client.labels
Class DataLabelsData

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.labels.DataLabelsData

public class DataLabelsData
extends Object

An object that represents the state information that will be passed to any custom DataLabelsFormatter to allow for custom strings to be rendered as the data labels of a series. See the DataLabelsFormatter.format(DataLabelsData) method for more details on the capabilities that custom formatters can provide.

Since:
1.0.0
Author:
squinn@moxiegroup.com (Shawn Quinn)

Constructor Summary
DataLabelsData(com.google.gwt.core.client.JavaScriptObject data)
          This constructor needs to be public scope but you should not construct this object directly, but instead simply implement a custom DataLabelsFormatter and this API will pass you the appropriate instance of this object at runtime.
 
Method Summary
 com.google.gwt.core.client.JavaScriptObject getNativeData()
          Returns a pointer to the native Highchart's instance data object that this GWT instance is wrapping.
 double getPercentage()
          Return the point's percentage of the total.
 Point getPoint()
          Create a new GWT point instance that is connected to the Highcharts JS point instance associated with this data label.
 String getPointName()
          Return the name of the point (e.g.
 String getSeriesName()
          Return the name of the series that the data label is a part of (e.g.
 double getTotal()
          Return the total value at this point's x value.
 long getTotalAsLong()
          Return the total value at this point's x value as a long.
 double getXAsDouble()
          Return the x value of the point as a double.
 long getXAsLong()
          Return the x value of the point as a long.
 String getXAsString()
          Return the x value of the point as a string.
 double getYAsDouble()
          Return the y value of the point as a double.
 long getYAsLong()
          Return the y value of the point as a long.
 String getYAsString()
          Return the y value of the point as a string.
 boolean hasXValue()
          Returns 'true' if the X value associated with this data label is non null.
 boolean hasYValue()
          Returns 'true' if the Y value associated with this data label is non null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataLabelsData

public DataLabelsData(com.google.gwt.core.client.JavaScriptObject data)
This constructor needs to be public scope but you should not construct this object directly, but instead simply implement a custom DataLabelsFormatter and this API will pass you the appropriate instance of this object at runtime.

Parameters:
data - A reference to the native Highcharts javascript object.
Method Detail

getPercentage

public double getPercentage()
Return the point's percentage of the total. Stacked series and pies only.

Returns:
The percentage value of the total.

getSeriesName

public String getSeriesName()
Return the name of the series that the data label is a part of (e.g. "series.name").

Returns:
The name of the series that the data label is a part of

getPointName

public String getPointName()
Return the name of the point (e.g. "point.name") that the data label is associated with.

Returns:
The name of the point that the data label is associated with.

getPoint

public Point getPoint()
Create a new GWT point instance that is connected to the Highcharts JS point instance associated with this data label.

Returns:
A Point instance that is connected to the Highcharts data point associated with the data label.
Since:
1.4.0

getTotal

public double getTotal()
Return the total value at this point's x value. Stacked series only.

Returns:
The total value at this point's x value (only applicable in stacked series).

getTotalAsLong

public long getTotalAsLong()
Return the total value at this point's x value as a long. Stacked series only.

Returns:
Return the total value at this point's x value as a long.

hasXValue

public boolean hasXValue()
Returns 'true' if the X value associated with this data label is non null. This method is useful when rendering data labels in a chart that may contain null point values.

Returns:
'true' if the X value is non null, 'false' otherwise.
Since:
1.1.3

getXAsDouble

public double getXAsDouble()
Return the x value of the point as a double. An exception will be thrown if the native value of the object is not a number.

Returns:
The x value of the point as a double.

getXAsLong

public long getXAsLong()
Return the x value of the point as a long. An exception will be thrown if the native value of the object is not a number.

Returns:
The x value of the point as a long.

getXAsString

public String getXAsString()
Return the x value of the point as a string. An exception will be thrown if the native value of the object is not a string.

Returns:
The x value of the point as a string.

hasYValue

public boolean hasYValue()
Returns 'true' if the Y value associated with this data label is non null. This method is useful when rendering data labels in a chart that may contain null point values.

Returns:
'true' if the Y value is non null, 'false' otherwise.
Since:
1.1.3

getYAsDouble

public double getYAsDouble()
Return the y value of the point as a double. An exception will be thrown if the native value of the object is not a number.

Returns:
The y value of the point as a double.

getYAsLong

public long getYAsLong()
Return the y value of the point as a long. An exception will be thrown if the native value of the object is not a number.

Returns:
The y value of the point as a long.

getYAsString

public String getYAsString()
Return the y value of the point as a string. An exception will be thrown if the native value of the object is not a string.

Returns:
The y value of the point as a string.

getNativeData

public com.google.gwt.core.client.JavaScriptObject getNativeData()
Returns a pointer to the native Highchart's instance data object that this GWT instance is wrapping. For advanced JSNI use-cases only.

Returns:
The native Highcharts object instance that this GWT instance is associated with.
Since:
1.5.0


Copyright © 2015. All Rights Reserved.