public class Labels extends AbstractConfigurationObject
Modifier and Type | Method and Description |
---|---|
HorizontalAlign |
getAlign() |
Number[] |
getAutoRotation() |
Number |
getAutoRotationLimit() |
Number |
getDistance() |
Boolean |
getEnabled() |
String |
getFormat() |
String |
getFormatter() |
Number |
getPadding() |
Boolean |
getReserveSpace() |
String |
getRotation() |
Number |
getStaggerLines() |
Number |
getStep() |
Boolean |
getUseHTML() |
Number |
getX() |
Number |
getY() |
Number |
getZIndex() |
void |
setAlign(HorizontalAlign align)
What part of the string the given position is anchored to.
|
void |
setAutoRotation(Number[] autoRotation)
For horizontal axes, the allowed degrees of label rotation to prevent
overlapping labels.
|
void |
setAutoRotationLimit(Number autoRotationLimit)
When each category width is more than this many pixels, we don't apply
auto rotation.
|
void |
setDistance(Number distance)
Angular gauges and solid gauges only.
|
void |
setEnabled(Boolean enabled)
Enable or disable the axis labels.
|
void |
setFormat(String format)
A format string for the axis label.
|
void |
setFormatter(String _fn_formatter) |
void |
setPadding(Number padding)
The pixel padding for axis labels, to ensure white space between them.
|
void |
setReserveSpace(Boolean reserveSpace)
Whether to reserve space for the labels.
|
void |
setRotation(Number rotation) |
void |
setRotation(String rotation) |
void |
setRotationPerpendicular() |
void |
setStaggerLines(Number staggerLines)
Horizontal axes only.
|
void |
setStep(Number step)
To show only every n'th label on the axis, set the step to
n.
|
void |
setUseHTML(Boolean useHTML)
Whether to use HTML to render the labels.
|
void |
setX(Number x)
The x position offset of the label relative to the tick position on the
axis.
|
void |
setY(Number y)
The y position offset of the label relative to the tick position on the
axis.
|
void |
setZIndex(Number zIndex)
The Z index for the axis labels.
|
public Labels()
public Labels(Boolean enabled)
public HorizontalAlign getAlign()
setAlign(HorizontalAlign)
public void setAlign(HorizontalAlign align)
"left"
, "center"
or "right"
. The
exact position also depends on the labels.x
setting. Angular
gauges and solid gauges defaults to center
.
Defaults to: right
public Number[] getAutoRotation()
setAutoRotation(Number[])
public void setAutoRotation(Number[] autoRotation)
false
to disable rotation, which will cause
the labels to word-wrap if possible.
Defaults to: [-45]
public Number getAutoRotationLimit()
setAutoRotationLimit(Number)
public void setAutoRotationLimit(Number autoRotationLimit)
Defaults to: 80
public Number getDistance()
setDistance(Number)
public void setDistance(Number distance)
Defaults to: -25
public Boolean getEnabled()
setEnabled(Boolean)
public void setEnabled(Boolean enabled)
Defaults to: true
public String getFormat()
setFormat(String)
public void setFormat(String format)
Defaults to: {value}
public String getFormatter()
public void setFormatter(String _fn_formatter)
public Number getPadding()
setPadding(Number)
public void setPadding(Number padding)
Defaults to: 5
public Boolean getReserveSpace()
setReserveSpace(Boolean)
public void setReserveSpace(Boolean reserveSpace)
Defaults to: true
public Number getStaggerLines()
setStaggerLines(Number)
public void setStaggerLines(Number staggerLines)
public Number getStep()
setStep(Number)
public void setStep(Number step)
To show only every n'th label on the axis, set the step to n. Setting the step to 2 shows every other label.
By default, the step is calculated automatically to avoid overlap. To prevent this, set it to 1. This usually only happens on a category axis, and is often a sign that you have chosen the wrong axis type. Read more at Axis docs => What axis should I use?
public Boolean getUseHTML()
setUseHTML(Boolean)
public void setUseHTML(Boolean useHTML)
Defaults to: false
public Number getX()
setX(Number)
public void setX(Number x)
public Number getY()
setY(Number)
public void setY(Number y)
Defaults to: 3
public Number getZIndex()
setZIndex(Number)
public void setZIndex(Number zIndex)
Defaults to: 7
public String getRotation()
public void setRotation(String rotation)
public void setRotation(Number rotation)
public void setRotationPerpendicular()
Copyright © 2023. All rights reserved.