-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.axis.AxisRenderer,com.patrykandpatrick.vico.core.chart.insets.ChartInsetter,com.patrykandpatrick.vico.core.dimensions.BoundsAware
public abstract class Axis<Position extends AxisPosition> implements AxisRenderer<Position>
A basic implementation of AxisRenderer used throughout the library.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAxis.BuilderUsed to construct Axis instances.
public classAxis.SizeConstraintDefines how an Axis is to size itself.
For VerticalAxis, this defines the width.
For HorizontalAxis, this defines the height.
-
Field Summary
Fields Modifier and Type Field Description private final RectFboundsprivate TextComponentlabelprivate LineComponentaxisLineprivate LineComponenttickprivate LineComponentguidelineprivate FloattickLengthDpprivate Axis.SizeConstraintsizeConstraintprivate AxisValueFormatter<Position>valueFormatterprivate FloatlabelRotationDegreesprivate TextComponenttitleComponentprivate CharSequencetitleprivate final Positionposition
-
Constructor Summary
Constructors Constructor Description Axis()
-
Method Summary
Modifier and Type Method Description RectFgetBounds()The bounds of the abstract component. final TextComponentgetLabel()The TextComponent to use for labels. final UnitsetLabel(TextComponent label)The TextComponent to use for labels. final LineComponentgetAxisLine()The LineComponent to use for the axis line. final UnitsetAxisLine(LineComponent axisLine)The LineComponent to use for the axis line. final LineComponentgetTick()The LineComponent to use for ticks. final UnitsetTick(LineComponent tick)The LineComponent to use for ticks. final LineComponentgetGuideline()The LineComponent to use for guidelines. final UnitsetGuideline(LineComponent guideline)The LineComponent to use for guidelines. final FloatgetTickLengthDp()The tick length (in dp). final UnitsetTickLengthDp(Float tickLengthDp)The tick length (in dp). final Axis.SizeConstraintgetSizeConstraint()Used by Axis subclasses for sizing and layout. final UnitsetSizeConstraint(Axis.SizeConstraint sizeConstraint)Used by Axis subclasses for sizing and layout. final AxisValueFormatter<Position>getValueFormatter()The AxisValueFormatter for the axis. final UnitsetValueFormatter(AxisValueFormatter<Position> valueFormatter)The AxisValueFormatter for the axis. final FloatgetLabelRotationDegrees()The rotation of axis labels (in degrees). final UnitsetLabelRotationDegrees(Float labelRotationDegrees)The rotation of axis labels (in degrees). final TextComponentgetTitleComponent()An optional TextComponent to use as the axis title. final UnitsetTitleComponent(TextComponent titleComponent)An optional TextComponent to use as the axis title. final CharSequencegetTitle()The axis title. final UnitsetTitle(CharSequence title)The axis title. abstract PositiongetPosition()Defines the position of the axis relative to the Chart. UnitsetRestrictedBounds(RectF bounds)The bounds (RectF) passed here define the area where the AxisRenderer shouldn’t draw anything. -
Methods inherited from class com.patrykandpatrick.vico.core.axis.Axis
drawAboveChart, drawBehindChart -
Methods inherited from class com.patrykandpatrick.vico.core.axis.AxisRenderer
getHorizontalInsets, getInsets, setBounds -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getLabel
final TextComponent getLabel()
The TextComponent to use for labels.
-
setLabel
final Unit setLabel(TextComponent label)
The TextComponent to use for labels.
-
getAxisLine
final LineComponent getAxisLine()
The LineComponent to use for the axis line.
-
setAxisLine
final Unit setAxisLine(LineComponent axisLine)
The LineComponent to use for the axis line.
-
getTick
final LineComponent getTick()
The LineComponent to use for ticks.
-
setTick
final Unit setTick(LineComponent tick)
The LineComponent to use for ticks.
-
getGuideline
final LineComponent getGuideline()
The LineComponent to use for guidelines.
-
setGuideline
final Unit setGuideline(LineComponent guideline)
The LineComponent to use for guidelines.
-
getTickLengthDp
final Float getTickLengthDp()
The tick length (in dp).
-
setTickLengthDp
final Unit setTickLengthDp(Float tickLengthDp)
The tick length (in dp).
-
getSizeConstraint
final Axis.SizeConstraint getSizeConstraint()
Used by Axis subclasses for sizing and layout.
-
setSizeConstraint
final Unit setSizeConstraint(Axis.SizeConstraint sizeConstraint)
Used by Axis subclasses for sizing and layout.
-
getValueFormatter
final AxisValueFormatter<Position> getValueFormatter()
The AxisValueFormatter for the axis.
-
setValueFormatter
final Unit setValueFormatter(AxisValueFormatter<Position> valueFormatter)
The AxisValueFormatter for the axis.
-
getLabelRotationDegrees
final Float getLabelRotationDegrees()
The rotation of axis labels (in degrees).
-
setLabelRotationDegrees
final Unit setLabelRotationDegrees(Float labelRotationDegrees)
The rotation of axis labels (in degrees).
-
getTitleComponent
final TextComponent getTitleComponent()
An optional TextComponent to use as the axis title.
-
setTitleComponent
final Unit setTitleComponent(TextComponent titleComponent)
An optional TextComponent to use as the axis title.
-
getTitle
final CharSequence getTitle()
The axis title.
-
setTitle
final Unit setTitle(CharSequence title)
The axis title.
-
getPosition
abstract Position getPosition()
Defines the position of the axis relative to the Chart.
-
setRestrictedBounds
Unit setRestrictedBounds(RectF bounds)
The bounds (RectF) passed here define the area where the AxisRenderer shouldn’t draw anything.
-
-
-
-