-
public class YAxis extends AxisBase
Class representing the y-axis labels settings and its entries. Only use the setter methods to modify it. Do not access public variables directly. Be aware that not all features the YLabels class provides are suitable for the RadarChart. Customizations that affect the value range of the axis need to be applied before setting data for the chart.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumYAxis.YAxisLabelPositionenum for the position of the y-labels relative to the chart
public enumYAxis.AxisDependencyEnum that specifies the axis a DataSet should be plotted against, either LEFT or RIGHT.
-
Constructor Summary
Constructors Constructor Description YAxis()YAxis(YAxis.AxisDependency position)
-
Method Summary
Modifier and Type Method Description YAxis.AxisDependencygetAxisDependency()floatgetMinWidth()voidsetMinWidth(float minWidth)Sets the minimum width that the axis should take (in dp). floatgetMaxWidth()voidsetMaxWidth(float maxWidth)Sets the maximum width that the axis can take (in dp). YAxis.YAxisLabelPositiongetLabelPosition()returns the position of the y-labels voidsetPosition(YAxis.YAxisLabelPosition pos)sets the position of the y-labels floatgetLabelXOffset()returns the horizontal offset of the y-label voidsetLabelXOffset(float xOffset)sets the horizontal offset of the y-label booleanisDrawTopYLabelEntryEnabled()returns true if drawing the top y-axis label entry is enabled booleanisDrawBottomYLabelEntryEnabled()returns true if drawing the bottom y-axis label entry is enabled voidsetDrawTopYLabelEntry(boolean enabled)set this to true to enable drawing the top y-label entry. voidsetInverted(boolean enabled)If this is set to true, the y-axis is inverted which means that low values are on top ofthe chart, high valueson bottom. booleanisInverted()If this returns true, the y-axis is inverted. voidsetStartAtZero(boolean startAtZero)This method is deprecated.Use setAxisMinimum(...) / setAxisMaximum(...) instead. voidsetSpaceTop(float percent)Sets the top axis space in percent of the full range. floatgetSpaceTop()Returns the top axis space in percent of the full range. voidsetSpaceBottom(float percent)Sets the bottom axis space in percent of the full range. floatgetSpaceBottom()Returns the bottom axis space in percent of the full range. booleanisDrawZeroLineEnabled()voidsetDrawZeroLine(boolean mDrawZeroLine)Set this to true to draw the zero-line regardless of weather othergrid-lines are enabled or not. intgetZeroLineColor()voidsetZeroLineColor(int color)Sets the color of the zero line floatgetZeroLineWidth()voidsetZeroLineWidth(float width)Sets the width of the zero line in dp floatgetRequiredWidthSpace(Paint p)This is for normal (not horizontal) charts horizontal spacing. floatgetRequiredHeightSpace(Paint p)This is for HorizontalBarChart vertical spacing. booleanneedsOffset()Returns true if this axis needs horizontal offset, false if no offset is needed. booleanisUseAutoScaleMinRestriction()Returns true if autoscale restriction for axis min value is enabled voidsetUseAutoScaleMinRestriction(boolean isEnabled)Sets autoscale restriction for axis min value as enabled/disabled booleanisUseAutoScaleMaxRestriction()Returns true if autoscale restriction for axis max value is enabled voidsetUseAutoScaleMaxRestriction(boolean isEnabled)Sets autoscale restriction for axis max value as enabled/disabled voidcalculate(float dataMin, float dataMax)Calculates the minimum / maximum and range values of the axis with the givenminimum and maximum values from the chart data. -
Methods inherited from class com.github.mikephil.charting.components.AxisBase
addLimitLine, addLimitRange, disableAxisLineDashedLine, disableGridDashedLine, enableAxisLineDashedLine, enableGridDashedLine, getAxisLineColor, getAxisLineDashPathEffect, getAxisLineWidth, getAxisMaxLabels, getAxisMaximum, getAxisMinLabels, getAxisMinimum, getFormattedLabel, getGranularity, getGridColor, getGridDashPathEffect, getGridLineWidth, getLabelCount, getLimitLines, getLimitRanges, getLongestLabel, getLongestLabel, getSpaceMax, getSpaceMin, getSpecificPositions, getValueFormatter, isAxisLineDashedLineEnabled, isAxisMaxCustom, isAxisMinCustom, isCenterAxisLabelsEnabled, isDrawAxisLineEnabled, isDrawGridLinesBehindDataEnabled, isDrawGridLinesEnabled, isDrawLabelsEnabled, isDrawLimitLinesBehindDataEnabled, isForceLabelsEnabled, isGranularityEnabled, isGridDashedLineEnabled, isShowSpecificPositions, removeAllLimitLines, removeAllLimitRanges, removeLimitLine, removeLimitRange, resetAxisMaximum, resetAxisMinimum, setAxisLineColor, setAxisLineDashedLine, setAxisLineWidth, setAxisMaxLabels, setAxisMaxValue, setAxisMaximum, setAxisMinLabels, setAxisMinValue, setAxisMinimum, setCenterAxisLabels, setDrawAxisLine, setDrawGridLines, setDrawGridLinesBehindData, setDrawLabels, setDrawLimitLinesBehindData, setGranularity, setGranularityEnabled, setGridColor, setGridDashedLine, setGridLineWidth, setLabelCount, setLabelCount, setShowSpecificPositions, setSpaceMax, setSpaceMin, setSpecificPositions, setTextColor, setValueFormatter -
Methods inherited from class com.github.mikephil.charting.components.ComponentBase
getTextColor, getTextSize, getTypeface, getXOffset, getYOffset, isEnabled, setEnabled, setTextColor, setTextSize, setTypeface, setXOffset, setYOffset -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
YAxis
YAxis()
-
YAxis
YAxis(YAxis.AxisDependency position)
-
-
Method Detail
-
getAxisDependency
YAxis.AxisDependency getAxisDependency()
-
getMinWidth
float getMinWidth()
-
setMinWidth
void setMinWidth(float minWidth)
Sets the minimum width that the axis should take (in dp).
-
getMaxWidth
float getMaxWidth()
-
setMaxWidth
void setMaxWidth(float maxWidth)
Sets the maximum width that the axis can take (in dp).
-
getLabelPosition
YAxis.YAxisLabelPosition getLabelPosition()
returns the position of the y-labels
-
setPosition
void setPosition(YAxis.YAxisLabelPosition pos)
sets the position of the y-labels
-
getLabelXOffset
float getLabelXOffset()
returns the horizontal offset of the y-label
-
setLabelXOffset
void setLabelXOffset(float xOffset)
sets the horizontal offset of the y-label
-
isDrawTopYLabelEntryEnabled
boolean isDrawTopYLabelEntryEnabled()
returns true if drawing the top y-axis label entry is enabled
-
isDrawBottomYLabelEntryEnabled
boolean isDrawBottomYLabelEntryEnabled()
returns true if drawing the bottom y-axis label entry is enabled
-
setDrawTopYLabelEntry
void setDrawTopYLabelEntry(boolean enabled)
set this to true to enable drawing the top y-label entry. Disabling this can be helpfulwhen the top y-label andleft x-label interfere with each other. default: true
-
setInverted
void setInverted(boolean enabled)
If this is set to true, the y-axis is inverted which means that low values are on top ofthe chart, high valueson bottom.
-
isInverted
boolean isInverted()
If this returns true, the y-axis is inverted.
-
setStartAtZero
@Deprecated() void setStartAtZero(boolean startAtZero)
This method is deprecated.Use setAxisMinimum(...) / setAxisMaximum(...) instead.
-
setSpaceTop
void setSpaceTop(float percent)
Sets the top axis space in percent of the full range. Default 10f
-
getSpaceTop
float getSpaceTop()
Returns the top axis space in percent of the full range. Default 10f
-
setSpaceBottom
void setSpaceBottom(float percent)
Sets the bottom axis space in percent of the full range. Default 10f
-
getSpaceBottom
float getSpaceBottom()
Returns the bottom axis space in percent of the full range. Default 10f
-
isDrawZeroLineEnabled
boolean isDrawZeroLineEnabled()
-
setDrawZeroLine
void setDrawZeroLine(boolean mDrawZeroLine)
Set this to true to draw the zero-line regardless of weather othergrid-lines are enabled or not. Default: false
-
getZeroLineColor
int getZeroLineColor()
-
setZeroLineColor
void setZeroLineColor(int color)
Sets the color of the zero line
-
getZeroLineWidth
float getZeroLineWidth()
-
setZeroLineWidth
void setZeroLineWidth(float width)
Sets the width of the zero line in dp
-
getRequiredWidthSpace
float getRequiredWidthSpace(Paint p)
This is for normal (not horizontal) charts horizontal spacing.
-
getRequiredHeightSpace
float getRequiredHeightSpace(Paint p)
This is for HorizontalBarChart vertical spacing.
-
needsOffset
boolean needsOffset()
Returns true if this axis needs horizontal offset, false if no offset is needed.
-
isUseAutoScaleMinRestriction
@Deprecated() boolean isUseAutoScaleMinRestriction()
Returns true if autoscale restriction for axis min value is enabled
-
setUseAutoScaleMinRestriction
@Deprecated() void setUseAutoScaleMinRestriction(boolean isEnabled)
Sets autoscale restriction for axis min value as enabled/disabled
-
isUseAutoScaleMaxRestriction
@Deprecated() boolean isUseAutoScaleMaxRestriction()
Returns true if autoscale restriction for axis max value is enabled
-
setUseAutoScaleMaxRestriction
@Deprecated() void setUseAutoScaleMaxRestriction(boolean isEnabled)
Sets autoscale restriction for axis max value as enabled/disabled
-
calculate
void calculate(float dataMin, float dataMax)
Calculates the minimum / maximum and range values of the axis with the givenminimum and maximum values from the chart data.
- Parameters:
dataMin- the min value according to chart datadataMax- the max value according to chart data
-
-
-
-