com.vaadin.flow.component.charts.model.
Class DataLabelsRange
- java.lang.Object
-
- com.vaadin.flow.component.charts.model.AbstractConfigurationObject
-
- com.vaadin.flow.component.charts.model.AbstractDataLabels
-
- com.vaadin.flow.component.charts.model.DataLabelsRange
-
All Implemented Interfaces:
public class DataLabelsRange extends AbstractDataLabels
Extended data labels for range series types. Range series data labels have no
x
andy
options. Instead, they havexLow
,xHigh
,yLow
andyHigh
options to allow the higher and lower data label sets individually.See Also:
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.component.charts.model.AbstractDataLabels
OVERFLOW_JUSTIFY, OVERFLOW_NONE
-
-
Constructor Summary
Constructors Constructor Description DataLabelsRange()
DataLabelsRange(Boolean enabled)
-
Method Summary
All Methods Modifier and Type Method Description HorizontalAlign
getAlign()
Boolean
getAllowOverlap()
Color
getBackgroundColor()
Color
getBorderColor()
Number
getBorderRadius()
Number
getBorderWidth()
String
getClassName()
Color
getColor()
Boolean
getCrop()
Boolean
getDefer()
Boolean
getEnabled()
String
getFormat()
String
getFormatter()
Boolean
getInside()
String
getOverflow()
Number
getPadding()
Number
getRotation()
Boolean
getShadow()
Shape
getShape()
Style
getStyle()
Boolean
getUseHTML()
VerticalAlign
getVerticalAlign()
Number
getXHigh()
Number
getXLow()
Number
getYHigh()
Number
getYLow()
Number
getZIndex()
void
setAlign(HorizontalAlign align)
The alignment of the data label compared to the point.
void
setAllowOverlap(Boolean allowOverlap)
Whether to allow data labels to overlap.
void
setBackgroundColor(Color backgroundColor)
The background color or gradient for the data label.
void
setBorderColor(Color borderColor)
The border color for the data label.
void
setBorderRadius(Number borderRadius)
The border radius in pixels for the data label.
void
setBorderWidth(Number borderWidth)
The border width in pixels for the data label.
void
setClassName(String className)
A class name for the data label.
void
setColor(Color color)
The text color for the data labels.
void
setCrop(Boolean crop)
Whether to hide data labels that are outside the plot area.
void
setDefer(Boolean defer)
Whether to defer displaying the data labels until the initial series animation has finished.
void
setEnabled(Boolean enabled)
Enable or disable the data labels.
void
setFormat(String format)
A format string for the data label.
void
setFormatter(String _fn_formatter)
Callback JavaScript function to format the data label.
void
setInside(Boolean inside)
For points with an extent, like columns, whether to align the data label inside the box or to the actual value point.
void
setOverflow(String overflow)
How to handle data labels that flow outside the plot area.
void
setPadding(Number padding)
When either the
borderWidth
or thebackgroundColor
is set, this is the padding within the box.void
setRotation(Number rotation)
Text rotation in degrees.
void
setShadow(Boolean shadow)
The shadow of the box.
void
setShape(Shape shape)
The name of a symbol to use for the border around the label.
void
setStyle(Style style)
Styles for the label.
void
setUseHTML(Boolean useHTML)
Whether to use HTML to render the labels.
void
setVerticalAlign(VerticalAlign verticalAlign)
The vertical alignment of a data label.
void
setXHigh(Number xHigh)
X offset of the higher data labels relative to the point value.
void
setXLow(Number xLow)
X offset of the lower data labels relative to the point value.
void
setYHigh(Number yHigh)
Y offset of the higher data labels relative to the point value.
void
setYLow(Number yLow)
Y offset of the lower data labels relative to the point value.
void
setZIndex(Number zIndex)
The Z index of the data labels.
-
-
-
Constructor Detail
-
DataLabelsRange
public DataLabelsRange()
-
DataLabelsRange
public DataLabelsRange(Boolean enabled)
-
-
Method Detail
-
getAlign
public HorizontalAlign getAlign()
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 columns, 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
-
getAllowOverlap
public Boolean getAllowOverlap()
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
-
getBackgroundColor
public Color getBackgroundColor()
Specified by:
getBackgroundColor
in classAbstractDataLabels
See Also:
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
The background color or gradient for the data label. Defaults to
undefined
.Specified by:
setBackgroundColor
in classAbstractDataLabels
-
getBorderColor
public Color getBorderColor()
Specified by:
getBorderColor
in classAbstractDataLabels
See Also:
-
setBorderColor
public void setBorderColor(Color borderColor)
The border color for the data label. Defaults to
undefined
.Specified by:
setBorderColor
in classAbstractDataLabels
-
getBorderRadius
public Number getBorderRadius()
Specified by:
getBorderRadius
in classAbstractDataLabels
See Also:
-
setBorderRadius
public void setBorderRadius(Number borderRadius)
The border radius in pixels for the data label.
Defaults to: 0
Specified by:
setBorderRadius
in classAbstractDataLabels
-
getBorderWidth
public Number getBorderWidth()
Specified by:
getBorderWidth
in classAbstractDataLabels
See Also:
-
setBorderWidth
public void setBorderWidth(Number borderWidth)
The border width in pixels for the data label.
Defaults to: 0
Specified by:
setBorderWidth
in classAbstractDataLabels
-
getClassName
public String getClassName()
Specified by:
getClassName
in classAbstractDataLabels
See Also:
-
setClassName
public void setClassName(String className)
A class name for the data label. Particularly in styled mode, this can be used to give each series' or point's data label unique styling. In addition to this option, a default color class name is added so that we can give the labels a contrast text shadow.
Specified by:
setClassName
in classAbstractDataLabels
-
getColor
public Color getColor()
Specified by:
getColor
in classAbstractDataLabels
See Also:
-
setColor
public void setColor(Color color)
The text color for the data labels. Defaults to
null
.Specified by:
setColor
in classAbstractDataLabels
-
getCrop
public Boolean getCrop()
Specified by:
getCrop
in classAbstractDataLabels
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.
Defaults to: true
Specified by:
setCrop
in classAbstractDataLabels
-
getDefer
public Boolean getDefer()
Specified by:
getDefer
in classAbstractDataLabels
See Also:
-
setDefer
public void setDefer(Boolean defer)
Whether to defer displaying the data labels until the initial series animation has finished.
Defaults to: true
Specified by:
setDefer
in classAbstractDataLabels
-
getEnabled
public Boolean getEnabled()
Specified by:
getEnabled
in classAbstractDataLabels
See Also:
-
setEnabled
public void setEnabled(Boolean enabled)
Enable or disable the data labels.
Defaults to: false
Specified by:
setEnabled
in classAbstractDataLabels
-
getFormat
public String getFormat()
Specified by:
getFormat
in classAbstractDataLabels
See Also:
-
setFormat
public void setFormat(String format)
A format string for the data label. Available variables are the same as for
formatter
.Defaults to: {y}
Specified by:
setFormat
in classAbstractDataLabels
-
getFormatter
public String getFormatter()
Specified by:
getFormatter
in classAbstractDataLabels
See Also:
-
setFormatter
public void setFormatter(String _fn_formatter)
Description copied from class:
AbstractDataLabels
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 classAbstractDataLabels
-
getInside
public Boolean getInside()
Specified by:
getInside
in classAbstractDataLabels
See Also:
-
setInside
public void setInside(Boolean inside)
For points with an extent, like columns, whether to align the data label inside the box or to the actual value point. Defaults to
false
in most cases,true
in stacked columns.Specified by:
setInside
in classAbstractDataLabels
-
getOverflow
public String getOverflow()
Specified by:
getOverflow
in classAbstractDataLabels
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, setcrop
tofalse
andoverflow
to"none"
.Defaults to: justify
Specified by:
setOverflow
in classAbstractDataLabels
-
getPadding
public Number getPadding()
Specified by:
getPadding
in classAbstractDataLabels
See Also:
-
setPadding
public void setPadding(Number padding)
When either the
borderWidth
or thebackgroundColor
is set, this is the padding within the box.Defaults to: 5
Specified by:
setPadding
in classAbstractDataLabels
-
getRotation
public Number getRotation()
Specified by:
getRotation
in classAbstractDataLabels
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.
Defaults to: 0
Specified by:
setRotation
in classAbstractDataLabels
-
getShadow
public Boolean getShadow()
Specified by:
getShadow
in classAbstractDataLabels
See Also:
-
setShadow
public void setShadow(Boolean shadow)
The shadow of the box. Works best with
borderWidth
orbackgroundColor
. Since 2.3 the shadow can be an object configuration containingcolor
,offsetX
,offsetY
,opacity
andwidth
.Defaults to: false
Specified by:
setShadow
in classAbstractDataLabels
-
getShape
public Shape getShape()
Specified by:
getShape
in classAbstractDataLabels
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.
Defaults to: square
Specified by:
setShape
in classAbstractDataLabels
-
getStyle
public Style getStyle()
Specified by:
getStyle
in classAbstractDataLabels
See Also:
-
setStyle
public void setStyle(Style style)
Styles for the label. The default
color
setting is"contrast"
, which is a pseudo color that Highcharts picks up and applies the maximum contrast to the underlying point item, for example the bar in a bar chart. ThetextOutline
is a pseudo property that applies an outline of the given width with the given color, which by default is the maximum contrast to the text. So a bright text color will result in a black text outline for maximum readability on a mixed background. In some cases, especially with grayscale text, the text outline doesn't work well, in which cases it can be disabled by setting it to"none"
.Defaults to: {"color": "contrast", "fontSize": "11px", "fontWeight": "bold", "textOutline": "1px contrast" }
Specified by:
setStyle
in classAbstractDataLabels
-
getUseHTML
public Boolean getUseHTML()
Specified by:
getUseHTML
in classAbstractDataLabels
See Also:
-
setUseHTML
public void setUseHTML(Boolean useHTML)
Whether to use HTML to render the labels.
Defaults to: false
Specified by:
setUseHTML
in classAbstractDataLabels
-
getVerticalAlign
public VerticalAlign getVerticalAlign()
Specified by:
getVerticalAlign
in classAbstractDataLabels
See Also:
-
setVerticalAlign
public void setVerticalAlign(VerticalAlign verticalAlign)
The vertical alignment of a data label. Can be one of
top
,middle
orbottom
. The default value depends on the data, for instance in a column chart, the label is above positive values and below negative values.Specified by:
setVerticalAlign
in classAbstractDataLabels
-
getXHigh
public Number getXHigh()
See Also:
-
setXHigh
public void setXHigh(Number xHigh)
X offset of the higher data labels relative to the point value.
Defaults to: 0
-
getXLow
public Number getXLow()
See Also:
-
setXLow
public void setXLow(Number xLow)
X offset of the lower data labels relative to the point value.
Defaults to: 0
-
getYHigh
public Number getYHigh()
See Also:
-
setYHigh
public void setYHigh(Number yHigh)
Y offset of the higher data labels relative to the point value.
Defaults to: -6
-
getYLow
public Number getYLow()
See Also:
-
setYLow
public void setYLow(Number yLow)
Y offset of the lower data labels relative to the point value.
Defaults to: 16
-
getZIndex
public Number getZIndex()
Specified by:
getZIndex
in classAbstractDataLabels
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
Specified by:
setZIndex
in classAbstractDataLabels
-
-