All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.pvanassen.highchart.api.label.LabelsItems Maven / Gradle / Ivy

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