
nl.pvanassen.highchart.api.label.LabelsItems Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of highchart-java-api Show documentation
Show all versions of highchart-java-api Show documentation
A Java API to generate highchart json on the server side.
The newest version!
package nl.pvanassen.highchart.api.label;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import nl.pvanassen.highchart.api.base.Style;
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(namespace = "labels")
public class LabelsItems {
private String html;
private final Style style;
public LabelsItems() {
style = new Style();
}
public LabelsItems center(int centerPosition, double top) {
getStyle().setProperty("left", centerPosition - getHtml().length() * 6 / 2 + "px");
getStyle().setProperty("top", top + "px");
return this;
}
public String getHtml() {
return html;
}
public Style getStyle() {
return style;
}
public LabelsItems setHtml(String html) {
this.html = html;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy