-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.axis.AxisRenderer,com.patrykandpatrick.vico.core.chart.insets.ChartInsetter,com.patrykandpatrick.vico.core.dimensions.BoundsAware
public final class HorizontalAxis<Position extends AxisPosition.Horizontal> extends Axis<Position>
An implementation of AxisRenderer used for horizontal axes. This class extends Axis.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classHorizontalAxis.BuilderA subclass of Axis.Builder used to build HorizontalAxis instances.
-
Field Summary
Fields Modifier and Type Field Description private IntegerlabelSpacingprivate IntegerlabelOffsetprivate AxisItemPlacer.HorizontalitemPlacerprivate final Positionpositionprivate final RectFboundsprivate TextComponentlabelprivate LineComponentaxisLineprivate LineComponenttickprivate LineComponentguidelineprivate FloattickLengthDpprivate Axis.SizeConstraintsizeConstraintprivate AxisValueFormatter<Position>valueFormatterprivate FloatlabelRotationDegreesprivate TextComponenttitleComponentprivate CharSequencetitle
-
Constructor Summary
Constructors Constructor Description HorizontalAxis(Position position)
-
Method Summary
Modifier and Type Method Description final IntegergetLabelSpacing()How often labels (and their corresponding ticks and guidelines) should be drawn. final UnitsetLabelSpacing(@Deprecated(message = `labelSpacing` is being replaced by `AxisItemPlacer.Horizontal`. Create a base implementation with the desired spacing via `AxisItemPlacer.Horizontal.default`, and use the `itemPlacer` field to apply it to this `HorizontalAxis`.) Integer labelSpacing)final IntegergetLabelOffset()The number of labels (and, for HorizontalLayout.FullWidth, their corresponding ticks and guidelines) to skip from the start. final UnitsetLabelOffset(@Deprecated(message = `labelOffset` is being replaced by `AxisItemPlacer.Horizontal`. Create a base implementation with the desired offset via `AxisItemPlacer.Horizontal.default`, and use the `itemPlacer` field to apply it to this `HorizontalAxis`.) Integer labelOffset)final AxisItemPlacer.HorizontalgetItemPlacer()Determines for what x values this HorizontalAxis is to display labels, ticks, and guidelines. final UnitsetItemPlacer(AxisItemPlacer.Horizontal itemPlacer)Determines for what x values this HorizontalAxis is to display labels, ticks, and guidelines. PositiongetPosition()Defines the position of the axis relative to the Chart. 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. UnitdrawBehindChart(ChartDrawContext context)Called before the Chart is drawn. UnitdrawAboveChart(ChartDrawContext context)Called after the Chart is drawn. UnitgetInsets(MeasureContext context, Insets outInsets, HorizontalDimensions horizontalDimensions)Called during the measurement phase, before getHorizontalInsets. -
Methods inherited from class com.patrykandpatrick.vico.core.axis.horizontal.HorizontalAxis
setRestrictedBounds -
Methods inherited from class com.patrykandpatrick.vico.core.axis.AxisRenderer
getHorizontalInsets, setBounds -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
HorizontalAxis
HorizontalAxis(Position position)
-
-
Method Detail
-
getLabelSpacing
final Integer getLabelSpacing()
How often labels (and their corresponding ticks and guidelines) should be drawn.
-
setLabelSpacing
final Unit setLabelSpacing(@Deprecated(message = `labelSpacing` is being replaced by `AxisItemPlacer.Horizontal`. Create a base implementation with the desired spacing via `AxisItemPlacer.Horizontal.default`, and use the `itemPlacer` field to apply it to this `HorizontalAxis`.) Integer labelSpacing)
-
getLabelOffset
final Integer getLabelOffset()
The number of labels (and, for HorizontalLayout.FullWidth, their corresponding ticks and guidelines) to skip from the start.
-
setLabelOffset
final Unit setLabelOffset(@Deprecated(message = `labelOffset` is being replaced by `AxisItemPlacer.Horizontal`. Create a base implementation with the desired offset via `AxisItemPlacer.Horizontal.default`, and use the `itemPlacer` field to apply it to this `HorizontalAxis`.) Integer labelOffset)
-
getItemPlacer
final AxisItemPlacer.Horizontal getItemPlacer()
Determines for what x values this HorizontalAxis is to display labels, ticks, and guidelines.
-
setItemPlacer
final Unit setItemPlacer(AxisItemPlacer.Horizontal itemPlacer)
Determines for what x values this HorizontalAxis is to display labels, ticks, and guidelines.
-
getPosition
Position getPosition()
Defines the position of the axis relative to the Chart.
-
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.
-
drawBehindChart
Unit drawBehindChart(ChartDrawContext context)
Called before the Chart is drawn. Implementations should rely on this function to draw themselves, unless they need to draw something above the Chart.
- Parameters:
context- holds the information needed to draw the axis.
-
drawAboveChart
Unit drawAboveChart(ChartDrawContext context)
Called after the Chart is drawn. Implementations can use this function to draw content above the Chart.
- Parameters:
context- holds the information needed to draw the axis.
-
getInsets
Unit getInsets(MeasureContext context, Insets outInsets, HorizontalDimensions horizontalDimensions)
Called during the measurement phase, before getHorizontalInsets. Both horizontal and vertical insets can be requested from this function. The final inset for a given edge of the associated Chart is the largest of the insets requested for the edge.
- Parameters:
context- holds data used for the measuring of components.outInsets- used to store the requested insets.horizontalDimensions- the associated Chart’s HorizontalDimensions.
-
-
-
-