-
- 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 VerticalAxis<Position extends AxisPosition.Vertical> extends Axis<Position>
An implementation of AxisRenderer used for vertical axes. This class extends Axis.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumVerticalAxis.HorizontalLabelPositionDefines the horizontal position of each of a vertical axis’s labels relative to the axis line.
public enumVerticalAxis.VerticalLabelPositionDefines the vertical position of each of a horizontal axis’s labels relative to the label’s corresponding tick.
public final classVerticalAxis.BuilderA subclass of Axis.Builder used to build VerticalAxis instances.
-
Field Summary
Fields Modifier and Type Field Description private IntegermaxLabelCountprivate FloatlabelSpacingprivate VerticalAxis.HorizontalLabelPositionhorizontalLabelPositionprivate VerticalAxis.VerticalLabelPositionverticalLabelPositionprivate final Positionpositionprivate final RectFboundsprivate TextComponentlabelprivate LineComponentaxisLineprivate LineComponenttickprivate LineComponentguidelineprivate FloattickLengthDpprivate Axis.SizeConstraintsizeConstraintprivate AxisValueFormatter<Position>valueFormatterprivate FloatlabelRotationDegreesprivate TextComponenttitleComponentprivate CharSequencetitle
-
Constructor Summary
Constructors Constructor Description VerticalAxis(Position position)
-
Method Summary
Modifier and Type Method Description final IntegergetMaxLabelCount()The maximum label count. final UnitsetMaxLabelCount(Integer maxLabelCount)The maximum label count. final FloatgetLabelSpacing()The label spacing (in dp). final UnitsetLabelSpacing(Float labelSpacing)The label spacing (in dp). final VerticalAxis.HorizontalLabelPositiongetHorizontalLabelPosition()Defines the horizontal position of each axis label relative to the axis line. final UnitsetHorizontalLabelPosition(VerticalAxis.HorizontalLabelPosition horizontalLabelPosition)Defines the horizontal position of each axis label relative to the axis line. final VerticalAxis.VerticalLabelPositiongetVerticalLabelPosition()Defines the vertical position of each axis label relative to its corresponding tick. final UnitsetVerticalLabelPosition(VerticalAxis.VerticalLabelPosition verticalLabelPosition)Defines the vertical position of each axis label relative to its corresponding tick. 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. UnitgetHorizontalInsets(MeasureContext context, Float availableHeight, HorizontalInsets outInsets)Called during the measurement phase, after getInsets. UnitgetInsets(MeasureContext context, Insets outInsets, HorizontalDimensions horizontalDimensions)Called during the measurement phase, before getHorizontalInsets. -
Methods inherited from class com.patrykandpatrick.vico.core.axis.vertical.VerticalAxis
setRestrictedBounds -
Methods inherited from class com.patrykandpatrick.vico.core.axis.AxisRenderer
setBounds -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
VerticalAxis
VerticalAxis(Position position)
-
-
Method Detail
-
getMaxLabelCount
final Integer getMaxLabelCount()
The maximum label count.
-
setMaxLabelCount
final Unit setMaxLabelCount(Integer maxLabelCount)
The maximum label count.
-
getLabelSpacing
final Float getLabelSpacing()
The label spacing (in dp).
-
setLabelSpacing
final Unit setLabelSpacing(Float labelSpacing)
The label spacing (in dp).
-
getHorizontalLabelPosition
final VerticalAxis.HorizontalLabelPosition getHorizontalLabelPosition()
Defines the horizontal position of each axis label relative to the axis line.
-
setHorizontalLabelPosition
final Unit setHorizontalLabelPosition(VerticalAxis.HorizontalLabelPosition horizontalLabelPosition)
Defines the horizontal position of each axis label relative to the axis line.
-
getVerticalLabelPosition
final VerticalAxis.VerticalLabelPosition getVerticalLabelPosition()
Defines the vertical position of each axis label relative to its corresponding tick.
-
setVerticalLabelPosition
final Unit setVerticalLabelPosition(VerticalAxis.VerticalLabelPosition verticalLabelPosition)
Defines the vertical position of each axis label relative to its corresponding tick.
-
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.
-
getHorizontalInsets
Unit getHorizontalInsets(MeasureContext context, Float availableHeight, HorizontalInsets outInsets)
Called during the measurement phase, after getInsets. Only horizontal insets can be requested from this function. Unless the available height is of interest, getInsets can be used to set all insets. 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.availableHeight- the available height.outInsets- used to store the requested insets.
-
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.
-
-
-
-