Class DataLabels

All Implemented Interfaces:
Serializable

@Generated(value="This class was generated", comments="Incorrect and missing API should be reported") public class DataLabels extends AbstractDataLabels

DataLabels class.

Version:
$Id: $Id
Author:
Vaadin
See Also:
  • Constructor Details

    • DataLabels

      public DataLabels()

      Constructor for DataLabels.

    • DataLabels

      public DataLabels(Boolean enabled)

      Constructor for DataLabels.

      Parameters:
      enabled - a Boolean object.
  • Method Details

    • getAlign

      public HorizontalAlign getAlign()

      Getter for the field align.

      Returns:
      a HorizontalAlign object.
      See Also:
    • setAlign

      public void setAlign(HorizontalAlign align)
      The alignment of the data label compared to the point. If right, the right side of the label should be touching the point. For points with an extent, like map areas, the alignments also dictates how to align it inside the box, as given with the inside option. Can be one of "left", "center" or "right".

      Defaults to: center

      Parameters:
      align - a HorizontalAlign object.
    • getAllowOverlap

      public Boolean getAllowOverlap()

      Getter for the field allowOverlap.

      Returns:
      a Boolean object.
      See Also:
    • setAllowOverlap

      public void setAllowOverlap(Boolean allowOverlap)
      Whether to allow data labels to overlap. To make the labels less sensitive for overlapping, the dataLabels.padding can be set to 0.

      Defaults to: false

      Parameters:
      allowOverlap - a Boolean object.
    • getBackgroundColor

      public Color getBackgroundColor()

      Getter for the field backgroundColor.

      Specified by:
      getBackgroundColor in class AbstractDataLabels
      Returns:
      a Color object.
      See Also:
    • setBackgroundColor

      public void setBackgroundColor(Color backgroundColor)
      The background color or gradient for the data label. The background color or gradient for the data label. Defaults to undefined.
      Specified by:
      setBackgroundColor in class AbstractDataLabels
      Parameters:
      backgroundColor - a Color object.
    • getBorderColor

      public Color getBorderColor()

      Getter for the field borderColor.

      Specified by:
      getBorderColor in class AbstractDataLabels
      Returns:
      a Color object.
      See Also:
    • setBorderColor

      public void setBorderColor(Color borderColor)
      The border color for the data label. The border color for the data label. Defaults to undefined.
      Specified by:
      setBorderColor in class AbstractDataLabels
      Parameters:
      borderColor - a Color object.
    • getBorderRadius

      public Number getBorderRadius()

      Getter for the field borderRadius.

      Specified by:
      getBorderRadius in class AbstractDataLabels
      Returns:
      a Number object.
      See Also:
    • setBorderRadius

      public void setBorderRadius(Number borderRadius)
      The border radius in pixels for the data label. The border radius in pixels for the data label.

      Defaults to: 0

      Specified by:
      setBorderRadius in class AbstractDataLabels
      Parameters:
      borderRadius - a Number object.
    • getBorderWidth

      public Number getBorderWidth()

      Getter for the field borderWidth.

      Specified by:
      getBorderWidth in class AbstractDataLabels
      Returns:
      a Number object.
      See Also:
    • setBorderWidth

      public void setBorderWidth(Number borderWidth)
      The border width in pixels for the data label. The border width in pixels for the data label.

      Defaults to: 0

      Specified by:
      setBorderWidth in class AbstractDataLabels
      Parameters:
      borderWidth - a Number object.
    • getColor

      public Color getColor()

      Getter for the field color.

      Specified by:
      getColor in class AbstractDataLabels
      Returns:
      a Color object.
      See Also:
    • setColor

      public void setColor(Color color)
      The text color for the data labels. The text color for the data labels. Defaults to null. Note that data labels in Highmaps by default have a style.HcTextStroke in order to make the text readable against any background. When the color is changed, it is also recommended to change this.
      Specified by:
      setColor in class AbstractDataLabels
      Parameters:
      color - a Color object.
    • getCrop

      public Boolean getCrop()

      Getter for the field crop.

      Specified by:
      getCrop in class AbstractDataLabels
      Returns:
      a Boolean object.
      See Also:
    • setCrop

      public void setCrop(Boolean crop)
      Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot area according to the overflow option. Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot area according to the overflow option.

      Defaults to: true

      Specified by:
      setCrop in class AbstractDataLabels
      Parameters:
      crop - a Boolean object.
    • getEnabled

      public Boolean getEnabled()

      Getter for the field enabled.

      Returns:
      a Boolean object.
      See Also:
    • setEnabled

      public void setEnabled(Boolean enabled)
      Enable or disable the data labels. Enable or disable the data labels.

      Defaults to: false

      Specified by:
      setEnabled in class AbstractDataLabels
      Parameters:
      enabled - a Boolean object.
    • getFormat

      public String getFormat()

      Getter for the field format.

      Specified by:
      getFormat in class AbstractDataLabels
      Returns:
      a String object.
      See Also:
    • setFormat

      public void setFormat(String format)
      A format string for the data label. Available variables are the same as for formatter. A format string for the data label. Available variables are the same as for formatter.

      Defaults to: {point.value}

      Specified by:
      setFormat in class AbstractDataLabels
      Parameters:
      format - a String object.
    • getFormatter

      public String getFormatter()

      getFormatter.

      Specified by:
      getFormatter in class AbstractDataLabels
      Returns:
      a String object.
      See Also:
    • setFormatter

      public void setFormatter(String _fn_formatter)
      Callback JavaScript function to format the data label. Note that if a format is defined, the format takes precedence and the formatter is ignored.
      Specified by:
      setFormatter in class AbstractDataLabels
      Parameters:
      _fn_formatter - a String object.
    • getOverflow

      public String getOverflow()

      Getter for the field overflow.

      Specified by:
      getOverflow in class AbstractDataLabels
      Returns:
      a String object.
      See Also:
    • setOverflow

      public void setOverflow(String overflow)
      How to handle data labels that flow outside the plot area. The default is justify, which aligns them inside the plot area. For columns and bars, this means it will be moved inside the bar. To display data labels outside the plot area, set crop to false and overflow to "none". How to handle data labels that flow outside the plot area. The default is justify, which aligns them inside the plot area. For columns and bars, this means it will be moved inside the bar. To display data labels outside the plot area, set crop to false and overflow to "none".

      Defaults to: justify

      Specified by:
      setOverflow in class AbstractDataLabels
      Parameters:
      overflow - a String object.
    • getPadding

      public Number getPadding()

      Getter for the field padding.

      Specified by:
      getPadding in class AbstractDataLabels
      Returns:
      a Number object.
      See Also:
    • setPadding

      public void setPadding(Number padding)
      When either the borderWidth or the backgroundColor is set, this is the padding within the box. When either the borderWidth or the backgroundColor is set, this is the padding within the box.

      Defaults to: 0

      Specified by:
      setPadding in class AbstractDataLabels
      Parameters:
      padding - a Number object.
    • getRotation

      public Number getRotation()

      Getter for the field rotation.

      Specified by:
      getRotation in class AbstractDataLabels
      Returns:
      a Number object.
      See Also:
    • setRotation

      public void setRotation(Number rotation)
      Text rotation in degrees. Note that due to a more complex structure, backgrounds, borders and padding will be lost on a rotated data label. Text rotation in degrees. Note that due to a more complex structure, backgrounds, borders and padding will be lost on a rotated data label.

      Defaults to: 0

      Specified by:
      setRotation in class AbstractDataLabels
      Parameters:
      rotation - a Number object.
    • getShadow

      public Boolean getShadow()

      Getter for the field shadow.

      Specified by:
      getShadow in class AbstractDataLabels
      Returns:
      a Boolean object.
      See Also:
    • setShadow

      public void setShadow(Boolean shadow)
      The shadow of the box. The shadow of the box. Works best with borderWidth or backgroundColor. The shadow can also be an object configuration containing color, offsetX, offsetY, opacity and width.

      Defaults to: false

      Specified by:
      setShadow in class AbstractDataLabels
      Parameters:
      shadow - a Boolean object.
    • getShape

      public Shape getShape()

      Getter for the field shape.

      Specified by:
      getShape in class AbstractDataLabels
      Returns:
      a Shape object.
      See Also:
    • setShape

      public void setShape(Shape shape)
      The name of a symbol to use for the border around the label. Symbols are predefined functions on the Renderer object. The name of a symbol to use for the border around the label. Symbols are predefined functions on the Renderer object.

      Defaults to: square

      Specified by:
      setShape in class AbstractDataLabels
      Parameters:
      shape - a Shape object.
    • getStyle

      public Style getStyle()

      Getter for the field style.

      Specified by:
      getStyle in class AbstractDataLabels
      Returns:
      a Style object.
      See Also:
    • setStyle

      public void setStyle(Style style)
      Styles for the label. Styles for the label. Note that changes in the text color should be accompanied with changes in HcTextStroke in order for the text to stand out against the background.

      Defaults to: {"color": "contrast", "fontSize": "11px", "fontWeight": "bold"; "textShadow": "0 0 6px contrast, 0 0 3px contrast" }

      Specified by:
      setStyle in class AbstractDataLabels
      Parameters:
      style - a Style object.
    • getUseHTML

      public Boolean getUseHTML()

      Getter for the field useHTML.

      Specified by:
      getUseHTML in class AbstractDataLabels
      Returns:
      a Boolean object.
      See Also:
    • setUseHTML

      public void setUseHTML(Boolean useHTML)
      Whether to use HTML to render the labels. Whether to use HTML to render the labels.

      Defaults to: false

      Specified by:
      setUseHTML in class AbstractDataLabels
      Parameters:
      useHTML - a Boolean object.
    • getVerticalAlign

      public VerticalAlign getVerticalAlign()

      Getter for the field verticalAlign.

      Specified by:
      getVerticalAlign in class AbstractDataLabels
      Returns:
      a VerticalAlign object.
      See Also:
    • setVerticalAlign

      public void setVerticalAlign(VerticalAlign verticalAlign)
      The vertical alignment of a data label. The vertical alignment of a data label. Can be one of top, middle or bottom.
      Specified by:
      setVerticalAlign in class AbstractDataLabels
      Parameters:
      verticalAlign - a VerticalAlign object.
    • getX

      public Number getX()

      Getter for the field x.

      Returns:
      a Number object.
      See Also:
    • setX

      public void setX(Number x)
      The x position offset of the label relative to the point.

      Defaults to: 0

      Parameters:
      x - a Number object.
    • getY

      public Number getY()

      Getter for the field y.

      Returns:
      a Number object.
      See Also:
    • setY

      public void setY(Number y)
      The y position offset of the label relative to the point.

      Defaults to: -6

      Parameters:
      y - a Number object.
    • getZIndex

      public Number getZIndex()

      Getter for the field zIndex.

      Returns:
      a Number object.
      See Also:
    • setZIndex

      public void setZIndex(Number zIndex)
      The Z index of the data labels. The default Z index puts it above the series. Use a Z index of 2 to display it behind the series.

      Defaults to: 6

      Parameters:
      zIndex - a Number object.