public abstract class AxisModel extends ChartElement
Modifier and Type | Class and Description |
---|---|
class |
AxisModel.StackValue |
ChartElement.Predicate<T>
Modifier and Type | Field and Description |
---|---|
static int |
PLOT_DIRECTION_PROPERTY_KEY |
static int |
PLOT_ORIGIN_PROPERTY_KEY |
children
PROPERTY_CHANGED_MESSAGE, PROPERTY_CHANGING_MESSAGE, trackPropertyChanged, trackPropertyChanging
Constructor and Description |
---|
AxisModel()
Creates an instance of the
AxisModel class. |
Modifier and Type | Method and Description |
---|---|
void |
applyLayoutRounding()
Applies layout snapping and corrects rounding errors.
|
ModifyChildrenResult |
canAddChild(ChartNode child)
Gets a
ModifyChildrenResult value that determines if a child can be added to this element. |
Object |
convertPhysicalUnitsToData(double coordinate)
Calculates the value which corresponds to the provided axis coordinate.
|
AxisPlotInfo |
createPlotInfo(Object value)
Creates an instance of the
AxisPlotInfo class containing the plot information about the provided
axis value. |
RadThickness |
desiredMargin()
Returns the desired margin for the axis associated with this
AxisModel . |
abstract AxisLabelModel |
generateLastLabel() |
AxisPlotMode |
getActualPlotMode()
Gets a value from the
AxisPlotMode enum depicting the plot mode
actually used by the axis associated with this AxisModel . |
Object |
getCombineGroupKey(DataPoint point)
Gets the key used to group series when combination mode like STACK is specified.
|
RadSize |
getDesiredSize() |
AxisTickModel |
getFirstTick()
Gets an instance of the
AxisTickModel class representing the first tick of the axis. |
AxisHorizontalLocation |
getHorizontalLocation()
Gets a
AxisHorizontalLocation value determining
the horizontal location of the axis (rendered vertically) in relation to the plot area. |
boolean |
getIsPrimary()
Gets a boolean value determining whether the current
AxisModel
describes a primary axis in the associated chart. |
Object |
getLabelContent(AxisTickModel tick) |
AxisLabelFitMode |
getLabelFitMode()
Gets a value from the
AxisLabelFitMode enum which determines
how labels are positioned on the axis. |
String |
getLabelFormat()
|
int |
getLabelInterval()
Gets the label interval in count of label positions.
|
AxisLabelLayoutMode |
getLabelLayoutMode()
Gets the label layout mode.
|
float |
getLabelMargin()
Gets the margin between the label and the axis line.
|
int |
getLabelOffset()
Gets the index of the label from the first label to be displayed.
|
ElementCollection<AxisLabelModel> |
getLabels()
Gets the
ElementCollection instance holding all
available labels on the axis. |
Function<Object,String> |
getLabelValueToStringConverter() |
AxisLastLabelVisibility |
getLastLabelVisibility()
Gets a value from the
AxisLastLabelVisibility enum which determines how the last axis label will be displayed. |
AxisTickModel |
getLastTick()
Gets an instance of the
AxisTickModel class representing the last tick of the axis. |
float |
getLineThickness()
|
float |
getMajorTickLength()
Gets the length of a single tick presented on the axis.
|
int |
getMajorTickOffset()
Gets the index of the tick from the first tick to be displayed.
|
Iterable<AxisTickModel> |
getMajorTicks()
Gets the
Iterable collection with all the major ticks currently present on the axis. |
double |
getNormalizedLabelRotationAngle()
Gets the normalized rotation angle of the labels.
|
boolean |
getShowLabels()
Gets a boolean value indicating whether labels will be displayed on this axis.
|
AxisModel.StackValue |
getStackValue(DataPoint point)
Gets the value for a DataPoint used by a CombineStrategy to calculate the stack sum for each stack group.
|
float |
getTickThickness()
Gets the thickness in pixels of a single tick presented on the axis.
|
AxisType |
getType()
|
AxisVerticalLocation |
getVerticalLocation()
Gets a
AxisVerticalLocation value determining
the horizontal location of the axis (rendered horizontally) in relation to the plot area. |
int |
getWidth() |
boolean |
isDataReady() |
boolean |
isPlotValid()
Gets a boolean value determining whether the current plot is valid.
|
boolean |
isUpdated()
Gets a boolean value indicating whether the current
AxisModel class
is in an up-to-date state. |
abstract int |
majorTickCount()
Gets the count of the major ticks currently generated
in this
AxisModel . |
boolean |
measure(RadSize availableSize)
Measures the axis associated with this
AxisModel and initializes its desired size. |
void |
onPanOffsetChanged()
Called when the pan offset of the owning chart changes.
|
void |
onZoomChanged()
Called when the zoom factor of the owning chart changes.
|
void |
plot(AxisUpdateContext context)
Plots the axis elements using the provided
AxisUpdateContext . |
void |
resetState()
Resets the state of the current
AxisModel instance. |
void |
setHorizontalLocation(AxisHorizontalLocation value)
Sets a
AxisHorizontalLocation value determining
the horizontal location of the axis (rendered vertically) in relation to the plot area. |
void |
setIsPrimary(boolean value)
Sets a boolean value determining whether the current
AxisModel
describes a primary axis in the associated chart. |
void |
setLabelFitMode(AxisLabelFitMode value)
Sets a value from the
AxisLabelFitMode enum which determines
how labels are positioned on the axis. |
void |
setLabelFormat(String value)
|
void |
setLabelInterval(int value)
Sets the label interval in count of label positions.
|
void |
setLabelLayoutMode(AxisLabelLayoutMode value)
Sets the labels layout mode.
|
void |
setLabelMargin(float value)
Sets the margin between the label and the axis line.
|
void |
setLabelOffset(int value)
Sets the index of the label from the first label to be displayed.
|
void |
setLabelValueToStringConverter(Function<Object,String> converter) |
void |
setLastLabelVisibility(AxisLastLabelVisibility value)
Gets a value from the
AxisLastLabelVisibility enum which determines how the last axis label will be displayed. |
void |
setLineThickness(float value)
|
void |
setMajorTickLength(float value)
Sets the length of a single tick presented on the axis.
|
void |
setMajorTickOffset(int value)
Sets the index of the tick from the first tick to be displayed.
|
void |
setNormalizedLabelRotationAngle(double value)
Gets the normalized rotation angle of the labels.
|
void |
setShowLabels(boolean value)
Sets a value indicating whether labels will be displayed on this axis.
|
void |
setTickThickness(float value)
Sets the thickness in pixels of a single tick presented on the axis.
|
void |
setType(AxisType value)
|
void |
setVerticalLocation(AxisVerticalLocation value)
Sets a
AxisVerticalLocation value determining
the horizontal location of the axis (rendered horizontally) in relation to the plot area. |
void |
setWidth(int value) |
ElementCollection<AxisTickModel> |
ticks()
Returns an instance of the
ElementCollection class
holding all ticks associated with the current axis. |
AxisTitleModel |
title()
Gets an instance of the
AxisTitleModel class representing the title associated with this AxisModel |
void |
update(AxisUpdateContext context)
Updates the current
AxisModel instance with the
provided AxisUpdateContext . |
void |
updateTicksVisibility(RadRect clipRect)
Calculates which ticks should be visible according to the provided plot bounds.
|
enumDescendants, enumDescendants, enumDescendants, findAncestor, findDescendant, getPresenter, isAncestorOf, setPresenter
arrange, arrange, chartArea, clearValue, collectionIndex, getLayoutSlot, getNodeState, getParent, index, invalidate, isTreeLoaded, isVisible, load, setIsVisible, setParent, setValue
getTypedValue, getValue, isLocalValue
public static final int PLOT_ORIGIN_PROPERTY_KEY
public static final int PLOT_DIRECTION_PROPERTY_KEY
public AxisModel()
AxisModel
class.public int getWidth()
public void setWidth(int value)
public RadSize getDesiredSize()
public boolean isUpdated()
AxisModel
class
is in an up-to-date state.true
if the state is up to date, otherwise false
.public boolean getIsPrimary()
AxisModel
describes a primary axis in the associated chart.true
if the axis is primary, otherwise false
.public void setIsPrimary(boolean value)
AxisModel
describes a primary axis in the associated chart.value
- true
if the axis will be primary, otherwise false
.public abstract int majorTickCount()
AxisModel
.public RadThickness desiredMargin()
AxisModel
.RadThickness
class describing the margin.public boolean isPlotValid()
true
if the plot is valid, otherwise false
.public String getLabelFormat()
Axis
associated with this AxisModel
.public void setLabelFormat(String value)
Axis
associated with this AxisModel
.value
- the label format.public AxisLastLabelVisibility getLastLabelVisibility()
AxisLastLabelVisibility
enum which determines how the last axis label will be displayed.public void setLastLabelVisibility(AxisLastLabelVisibility value)
AxisLastLabelVisibility
enum which determines how the last axis label will be displayed.value
- the last label display mode.public AxisLabelFitMode getLabelFitMode()
AxisLabelFitMode
enum which determines
how labels are positioned on the axis.AxisLabelFitMode
value.public void setLabelFitMode(AxisLabelFitMode value)
AxisLabelFitMode
enum which determines
how labels are positioned on the axis.value
- the AxisLabelFitMode
value.public int getLabelInterval()
public void setLabelInterval(int value)
value
- the count of the positions which represent the label interval.public int getLabelOffset()
public void setLabelOffset(int value)
public int getMajorTickOffset()
public void setMajorTickOffset(int value)
public double getNormalizedLabelRotationAngle()
public void setNormalizedLabelRotationAngle(double value)
value
- the rotation angle.public Iterable<AxisTickModel> getMajorTicks()
Iterable
collection with all the major ticks currently present on the axis.public ElementCollection<AxisLabelModel> getLabels()
ElementCollection
instance holding all
available labels on the axis.public float getTickThickness()
public void setTickThickness(float value)
value
- the thickness.public float getLabelMargin()
public void setLabelMargin(float value)
value
- The label margin.public boolean getShowLabels()
true
if labels are shown, otherwise false
.public void setShowLabels(boolean value)
value
- true
if labels are shown, otherwise false
.public AxisLabelLayoutMode getLabelLayoutMode()
AxisLabelLayoutMode
for more information.public void setLabelLayoutMode(AxisLabelLayoutMode value)
AxisLabelLayoutMode
for more information.value
- The new layout mode.public float getMajorTickLength()
public void setMajorTickLength(float value)
value
- the tick length.public float getLineThickness()
Axis
.public void setLineThickness(float value)
value
- the thickness of the Axis
.public AxisHorizontalLocation getHorizontalLocation()
AxisHorizontalLocation
value determining
the horizontal location of the axis (rendered vertically) in relation to the plot area.AxisHorizontalLocation
value.public void setHorizontalLocation(AxisHorizontalLocation value)
AxisHorizontalLocation
value determining
the horizontal location of the axis (rendered vertically) in relation to the plot area.value
- the AxisHorizontalLocation
value.public AxisVerticalLocation getVerticalLocation()
AxisVerticalLocation
value determining
the horizontal location of the axis (rendered horizontally) in relation to the plot area.AxisVerticalLocation
value.public void setVerticalLocation(AxisVerticalLocation value)
AxisVerticalLocation
value determining
the horizontal location of the axis (rendered horizontally) in relation to the plot area.value
- the AxisVerticalLocation
value.public AxisTickModel getFirstTick()
AxisTickModel
class representing the first tick of the axis.
Can be called when the axis is loaded.AxisTickModel
instance.public AxisTickModel getLastTick()
AxisTickModel
class representing the last tick of the axis.
Can be called when the axis is loaded.AxisTickModel
instance.public AxisTitleModel title()
AxisTitleModel
class representing the title associated with this AxisModel
AxisTitleModel
instance.public AxisPlotMode getActualPlotMode()
AxisPlotMode
enum depicting the plot mode
actually used by the axis associated with this AxisModel
.AxisPlotMode
value.public ElementCollection<AxisTickModel> ticks()
ElementCollection
class
holding all ticks associated with the current axis.ElementCollection
instance.public void applyLayoutRounding()
ChartNode
applyLayoutRounding
in class ChartNode
public void resetState()
AxisModel
instance. Marks the plot data and the layout params
as invalid and resets the range.public void onZoomChanged()
public void onPanOffsetChanged()
public void update(AxisUpdateContext context)
AxisModel
instance with the
provided AxisUpdateContext
. Called by the
associated ChartAreaModel
.context
- the AxisUpdateContext
used for the update.public boolean measure(RadSize availableSize)
AxisModel
and initializes its desired size.availableSize
- an instance of RadSize
depicting the measure size for the axis.true
if a measure pass was performed, otherwise false
.public void plot(AxisUpdateContext context)
AxisUpdateContext
.context
- the AxisUpdateContext
public void updateTicksVisibility(RadRect clipRect)
clipRect
- an instance of the RadRect
class describing the plot bounds.public Object getCombineGroupKey(DataPoint point)
public void setLabelValueToStringConverter(Function<Object,String> converter)
public AxisModel.StackValue getStackValue(DataPoint point)
point
- the point for which we need to get the stack value.public boolean isDataReady()
public Object getLabelContent(AxisTickModel tick)
public ModifyChildrenResult canAddChild(ChartNode child)
ChartElement
ModifyChildrenResult
value that determines if a child can be added to this element.canAddChild
in class ChartElement
child
- The child to be considered.public AxisPlotInfo createPlotInfo(Object value)
AxisPlotInfo
class containing the plot information about the provided
axis value.value
- the value to create the plot information for.AxisPlotInfo
instance.public Object convertPhysicalUnitsToData(double coordinate)
coordinate
- the coordinate to calculate the value for.public abstract AxisLabelModel generateLastLabel()