org.moxieapps.gwt.highcharts.client
Class LabelItem

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<LabelItem>
      extended by org.moxieapps.gwt.highcharts.client.LabelItem

public class LabelItem
extends Configurable<LabelItem>

A simple configurable object that can be used to position arbitrary HTML labels anywhere in the chart area. After creating a LabelItem it can then be added to the chart via the BaseChart.setLabelItems(LabelItem...) method. Example usage:

 chart.setLabelItems(
    new LabelItem()
      .setHtml("United States")
      .setStyle(new Style()
         .setColor("#FF0000")
         .setTop("10px")
         .setLeft("10px")
      ),
    new LabelItem()
      .setHtml("Europe")
      .setStyle(new Style()
         .setColor("#0000FF")
         .setTop("10px")
         .setLeft("210px")
      ),
 );
 

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

Constructor Summary
LabelItem()
           
 
Method Summary
 LabelItem setHtml(String html)
          Convenience method for setting the 'html' option of the label item.
 LabelItem setStyle(Style style)
          Convenience method for setting the 'style' options of the label item.
 
Methods inherited from class org.moxieapps.gwt.highcharts.client.Configurable
getOptions, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelItem

public LabelItem()
Method Detail

setHtml

public LabelItem setHtml(String html)
Convenience method for setting the 'html' option of the label item. Equivalent to:

     labelItem.setOption("html", "Australia");
 
Inner HTML or text for the label. Defaults to "".

Parameters:
html - Inner HTML or text for the label.
Returns:
A reference to this LabelItem instance for convenient method chaining.

setStyle

public LabelItem setStyle(Style style)
Convenience method for setting the 'style' options of the label item. Equivalent to:

     labelItem.setOption("/style/left", "100px");
     labelItem.setOption("/style/top", "10px");
     etc.
 
CSS styles for each label. To position the label, use left and top like this:

    new LabelItem()
      .setHtml("Antarctica")
      .setStyle(new Style()
         .setColor("#0000FF")
         .setTop("10px")
         .setLeft("100px")
      )
 

Parameters:
style - CSS styles for each label
Returns:
A reference to this LabelItem instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.