public class LabelItem extends Configurable<LabelItem>
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")
),
);
| Constructor and Description |
|---|
LabelItem() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
getOptions, setOptionpublic LabelItem setHtml(String html)
labelItem.setOption("html", "Australia");
Inner HTML or text for the label. Defaults to "".html - Inner HTML or text for the label.LabelItem instance for convenient method chaining.public LabelItem setStyle(Style style)
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")
)
style - CSS styles for each labelLabelItem instance for convenient method chaining.Copyright © 2015. All Rights Reserved.