public abstract class Axis extends ChartElementPresenter implements ChartLabelRenderer
Modifier and Type | Field and Description |
---|---|
static int |
AXIS_Z_INDEX |
static String |
LABEL_COLOR |
static int |
LABEL_COLOR_PROPERTY_KEY |
static String |
LABEL_FIT_MODE |
static int |
LABEL_FIT_MODE_PROPERTY_KEY |
static String |
LABEL_FONT_KEY |
static int |
LABEL_FONT_PROPERTY_KEY |
static String |
LABEL_FONT_STYLE_KEY |
static int |
LABEL_FONT_STYLE_PROPERTY_KEY |
static String |
LABEL_ROTATION_ANGLE |
static int |
LABEL_ROTATION_ANGLE_PROPERTY_KEY |
static String |
LABEL_SIZE_KEY |
static int |
LABEL_SIZE_PROPERTY_KEY |
static String |
LINE_COLOR_KEY |
static String |
LINE_THICKNESS_KEY |
static String |
TICK_COLOR_KEY |
static int |
TICK_COLOR_PROPERTY_KEY |
static String |
TICK_THICKNESS_KEY |
static int |
TICK_THICKNESS_PROPERTY_KEY |
Modifier and Type | Method and Description |
---|---|
AxisType |
getAxisType()
|
abstract List<DataPoint> |
getDataPointsForValue(Object value) |
AxisLabelFitMode |
getLabelFitMode()
Gets a value from the
AxisLabelFitMode enum
that determines how the axis labels will be laid out when they are overlapping each other. |
Typeface |
getLabelFont()
Gets the labels
Typeface |
int |
getLabelFontStyle()
Gets the labels font style.
|
String |
getLabelFormat()
Gets the label format string.
|
int |
getLabelInterval()
Gets an integer determining the step between two visible ticks on the axis.
|
AxisLabelLayoutMode |
getLabelLayoutMode()
Gets the label layout mode.
|
float |
getLabelMargin()
Gets the margin of the labels.
|
int |
getLabelOffset()
Gets index-based offset of the first label to be displayed.
|
ChartLabelRenderer |
getLabelRenderer()
Gets the
ChartLabelRenderer responsible for drawing the axis labels. |
float |
getLabelRotationAngle()
Gets the rotation angle of the labels when LabelFitMode equals ROTATE.
|
float |
getLabelSize()
Gets the label size.
|
int |
getLabelTextColor()
Gets the labels color.
|
Function<Object,String> |
getLabelValueToStringConverter() |
AxisLastLabelVisibility |
getLastLabelVisibility()
Gets a value from the
AxisLastLabelVisibility enum
determining the strategy that defines the last axis label visibility. |
ChartLayoutContext |
getLastLayoutContext() |
RadRect |
getLayoutSlot(ChartNode node,
ChartLayoutContext context) |
int |
getMajorTickOffset()
Gets index-based offset of the first major tick to be displayed.
|
AxisModel |
getModel() |
boolean |
getShowLabels()
Gets a boolean value indicating whether labels will be displayed on this axis.
|
int |
getTickColor()
Gets the color used to display the axis ticks.
|
float |
getTickThickness()
Gets the thickness of a single tick present on the axis in pixels.
|
int |
getVerticalWidth() |
void |
render(Canvas canvas)
Used to render the current presenter instance onto the passed canvas object.
|
void |
renderLabel(Canvas canvas,
ChartNode dataPoint)
|
ChartLabelRenderer |
resolveLabelRenderer()
Gets the label renderer if set and if not, returns the main implementation.
|
void |
setAxisType(AxisType type)
|
void |
setLabelFitMode(AxisLabelFitMode value)
Sets a value from the
AxisLabelFitMode enum
that determines how the axis labels will be laid out when they are overlapping each other. |
void |
setLabelFont(Typeface value)
Sets the labels
Typeface . |
void |
setLabelFontStyle(int value)
Sets the labels font style.
|
void |
setLabelFormat(String format)
Sets the label format string.
|
void |
setLabelInterval(int value)
Sets an integer determining the step between two visible labels on the axis.
|
void |
setLabelLayoutMode(AxisLabelLayoutMode value)
Sets the labels layout mode.
|
void |
setLabelMargin(float offset)
Sets the margin of the labels.
|
void |
setLabelOffset(int value)
Sets index-based offset of the first label to be displayed.
|
void |
setLabelRenderer(ChartLabelRenderer value)
Sets a
ChartLabelRenderer object that will be responsible for drawing the axis labels. |
void |
setLabelRotationAngle(float value)
Sets the rotation angle of the labels when LabelFitMode equals ROTATE.
|
void |
setLabelSize(float value)
Sets the label size.
|
void |
setLabelTextColor(int color)
Sets the labels color.
|
void |
setLabelValueToStringConverter(Function<Object,String> converter) |
void |
setLastLabelVisibility(AxisLastLabelVisibility value)
Sets a value from the
AxisLastLabelVisibility enum
determining the strategy that defines the last axis label visibility. |
void |
setMajorTickOffset(int value)
Sets index-based offset of the first major tick to be displayed.
|
void |
setShowLabels(boolean value)
Sets a boolean value indicating whether labels will be displayed on this axis.
|
void |
setTickColor(int color)
Sets the color used to display the axis ticks.
|
void |
setTickThickness(float value)
Sets the thickness of a single tick present on the axis in pixels.
|
void |
setVerticalWidth(int value) |
attach, detach, getCanApplyPalette, getChart, getCollectionIndex, getPalette, getZIndex, invalidatePalette, onPaletteInvalidated, onPaletteUpdated, requestLayout, requestRender, setZIndex, updatePalette
getPaletteFamily, getPaletteFamilyCore, isLoaded, isPaletteApplied, isVisible, measureContent, paletteFamily, postRender, refreshNode, setCanApplyPalette, setPaletteFamily, setVisible, setVisible
getValue, resetPropertyValue, setValue, setValue
public static final int AXIS_Z_INDEX
public static final String LINE_THICKNESS_KEY
public static final String LINE_COLOR_KEY
public static final String LABEL_COLOR
public static final String LABEL_SIZE_KEY
public static final String LABEL_FONT_KEY
public static final String LABEL_FONT_STYLE_KEY
public static final String LABEL_FIT_MODE
public static final String LABEL_ROTATION_ANGLE
public static final String TICK_COLOR_KEY
public static final String TICK_THICKNESS_KEY
public static final int LABEL_COLOR_PROPERTY_KEY
public static final int LABEL_SIZE_PROPERTY_KEY
public static final int LABEL_FONT_PROPERTY_KEY
public static final int LABEL_FONT_STYLE_PROPERTY_KEY
public static final int LABEL_FIT_MODE_PROPERTY_KEY
public static final int LABEL_ROTATION_ANGLE_PROPERTY_KEY
public static final int TICK_COLOR_PROPERTY_KEY
public static final int TICK_THICKNESS_PROPERTY_KEY
public void setVerticalWidth(int value)
public int getVerticalWidth()
public AxisType getAxisType()
public void setAxisType(AxisType type)
type
- the type of the axis.public AxisModel getModel()
public float getLabelRotationAngle()
public void setLabelRotationAngle(float value)
value
- the rotation angle in degrees.public AxisLastLabelVisibility getLastLabelVisibility()
AxisLastLabelVisibility
enum
determining the strategy that defines the last axis label visibility.AxisLastLabelVisibility
enum
determining how the last label on the axis is displayed.public void setLastLabelVisibility(AxisLastLabelVisibility value)
AxisLastLabelVisibility
enum
determining the strategy that defines the last axis label visibility.value
- a value from the AxisLastLabelVisibility
enum
determining how the last label on the axis is displayed.public int getMajorTickOffset()
public void setMajorTickOffset(int value)
value
- the index of the first major tick on the axis to be displayed.public int getLabelOffset()
public void setLabelOffset(int value)
value
- the index of the first label on the axis to be displayed.public boolean getShowLabels()
true
if labels are visible, otherwise false
.public void setShowLabels(boolean value)
value
- true
if labels are visible, otherwise false
.public AxisLabelFitMode getLabelFitMode()
AxisLabelFitMode
enum
that determines how the axis labels will be laid out when they are overlapping each other.AxisLabelFitMode
value.public void setLabelFitMode(AxisLabelFitMode value)
AxisLabelFitMode
enum
that determines how the axis labels will be laid out when they are overlapping each other.value
- the AxisLabelFitMode
value.public void setLabelLayoutMode(AxisLabelLayoutMode value)
AxisLabelLayoutMode
for more information.value
- The new layout mode.public AxisLabelLayoutMode getLabelLayoutMode()
AxisLabelLayoutMode
for more information.public float getTickThickness()
public void setTickThickness(float value)
value
- the thickness of a tick in pixels.public void setTickColor(int color)
color
- the color for the ticks.public int getTickColor()
public int getLabelInterval()
public void setLabelInterval(int value)
value
- the amount of the omitted labels.public ChartLabelRenderer getLabelRenderer()
ChartLabelRenderer
responsible for drawing the axis labels.ChartLabelRenderer
instance.public void setLabelRenderer(ChartLabelRenderer value)
ChartLabelRenderer
object that will be responsible for drawing the axis labels.value
- the new label renderer.public ChartLayoutContext getLastLayoutContext()
public void render(Canvas canvas)
PresenterBase
render
in class PresenterBase
canvas
- the canvas onto which the presenter is to be rendered.public ChartLabelRenderer resolveLabelRenderer()
public RadRect getLayoutSlot(ChartNode node, ChartLayoutContext context)
public void renderLabel(Canvas canvas, ChartNode dataPoint)
ChartLabelRenderer
renderLabel
in interface ChartLabelRenderer
canvas
- The canvas to draw on.dataPoint
- The ChartNode
that is related to the label. For a series it will be a DataPoint
. For an Axis
it will be an AxisTickModel
.public int getLabelTextColor()
ChartLabelRenderer
getLabelTextColor
in interface ChartLabelRenderer
public void setLabelTextColor(int color)
ChartLabelRenderer
setLabelTextColor
in interface ChartLabelRenderer
color
- The labels color.public float getLabelSize()
ChartLabelRenderer
getLabelSize
in interface ChartLabelRenderer
public void setLabelSize(float value)
ChartLabelRenderer
setLabelSize
in interface ChartLabelRenderer
value
- The label size.public Typeface getLabelFont()
ChartLabelRenderer
Typeface
getLabelFont
in interface ChartLabelRenderer
public void setLabelFont(Typeface value)
ChartLabelRenderer
Typeface
.setLabelFont
in interface ChartLabelRenderer
value
- The new labels typeface.public int getLabelFontStyle()
ChartLabelRenderer
getLabelFontStyle
in interface ChartLabelRenderer
public void setLabelFontStyle(int value)
ChartLabelRenderer
setLabelFontStyle
in interface ChartLabelRenderer
value
- The new labels font style.public String getLabelFormat()
ChartLabelRenderer
getLabelFormat
in interface ChartLabelRenderer
public void setLabelFormat(String format)
ChartLabelRenderer
setLabelFormat
in interface ChartLabelRenderer
format
- The label format string. The format string is a standard Java format string.
For more information see the java formatter help page.public float getLabelMargin()
ChartLabelRenderer
getLabelMargin
in interface ChartLabelRenderer
public void setLabelMargin(float offset)
ChartLabelRenderer
setLabelMargin
in interface ChartLabelRenderer
offset
- The new labels margin.public Function<Object,String> getLabelValueToStringConverter()
getLabelValueToStringConverter
in interface ChartLabelRenderer
public void setLabelValueToStringConverter(Function<Object,String> converter)
setLabelValueToStringConverter
in interface ChartLabelRenderer