public class YAxis extends AxisBase
| Modifier and Type | Class and Description |
|---|---|
static class |
YAxis.AxisDependency
Enum that specifies the axis a DataSet should be plotted against, either LEFT or RIGHT.
|
static class |
YAxis.YAxisLabelPosition
enum for the position of the y-labels relative to the chart
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mDrawZeroLine
flag that indicates if the zero-line should be drawn regardless of other grid lines
|
protected boolean |
mInverted
flag that indicates if the axis is inverted or not
|
protected float |
mMaxWidth
the maximum width that the axis can take (in dp).
|
protected float |
mMinWidth
the minimum width that the axis should take (in dp).
|
protected float |
mSpacePercentBottom
axis space from the smallest value to the bottom in percent of the total axis range
|
protected float |
mSpacePercentTop
axis space from the largest value to the top in percent of the total axis range
|
protected int |
mZeroLineColor
Color of the zero line
|
protected float |
mZeroLineWidth
Width of the zero line in pixels
|
mAxisMaximum, mAxisMinimum, mAxisRange, mAxisValueFormatter, mCenterAxisLabels, mCenteredEntries, mCustomAxisMax, mCustomAxisMin, mDecimals, mDrawAxisLine, mDrawGridLines, mDrawGridLinesBehindData, mDrawLabels, mDrawLimitLineBehindData, mEntries, mEntryCount, mForceLabels, mGranularity, mGranularityEnabled, mLimitLines, mSpaceMax, mSpaceMinmEnabled, mTextColor, mTextSize, mTypeface, mXOffset, mYOffset| Constructor and Description |
|---|
YAxis() |
YAxis(YAxis.AxisDependency position) |
| Modifier and Type | Method and Description |
|---|---|
void |
calculate(float dataMin,
float dataMax)
Calculates the minimum / maximum and range values of the axis with the given
minimum and maximum values from the chart data.
|
YAxis.AxisDependency |
getAxisDependency() |
YAxis.YAxisLabelPosition |
getLabelPosition()
returns the position of the y-labels
|
float |
getLabelXOffset()
returns the horizontal offset of the y-label
|
float |
getMaxWidth() |
float |
getMinWidth() |
float |
getRequiredHeightSpace(android.graphics.Paint p)
This is for HorizontalBarChart vertical spacing.
|
float |
getRequiredWidthSpace(android.graphics.Paint p)
This is for normal (not horizontal) charts horizontal spacing.
|
float |
getSpaceBottom()
Returns the bottom axis space in percent of the full range.
|
float |
getSpaceTop()
Returns the top axis space in percent of the full range.
|
int |
getZeroLineColor() |
float |
getZeroLineWidth() |
boolean |
isDrawBottomYLabelEntryEnabled()
returns true if drawing the bottom y-axis label entry is enabled
|
boolean |
isDrawTopYLabelEntryEnabled()
returns true if drawing the top y-axis label entry is enabled
|
boolean |
isDrawZeroLineEnabled() |
boolean |
isInverted()
If this returns true, the y-axis is inverted.
|
boolean |
isUseAutoScaleMaxRestriction()
Deprecated.
|
boolean |
isUseAutoScaleMinRestriction()
Deprecated.
|
boolean |
needsOffset()
Returns true if this axis needs horizontal offset, false if no offset is needed.
|
void |
setDrawTopYLabelEntry(boolean enabled)
set this to true to enable drawing the top y-label entry.
|
void |
setDrawZeroLine(boolean mDrawZeroLine)
Set this to true to draw the zero-line regardless of weather other
grid-lines are enabled or not.
|
void |
setInverted(boolean enabled)
If this is set to true, the y-axis is inverted which means that low values are on top of
the chart, high values
on bottom.
|
void |
setLabelXOffset(float xOffset)
sets the horizontal offset of the y-label
|
void |
setMaxWidth(float maxWidth)
Sets the maximum width that the axis can take (in dp).
|
void |
setMinWidth(float minWidth)
Sets the minimum width that the axis should take (in dp).
|
void |
setPosition(YAxis.YAxisLabelPosition pos)
sets the position of the y-labels
|
void |
setSpaceBottom(float percent)
Sets the bottom axis space in percent of the full range.
|
void |
setSpaceTop(float percent)
Sets the top axis space in percent of the full range.
|
void |
setStartAtZero(boolean startAtZero)
Deprecated.
|
void |
setUseAutoScaleMaxRestriction(boolean isEnabled)
Deprecated.
|
void |
setUseAutoScaleMinRestriction(boolean isEnabled)
Deprecated.
|
void |
setZeroLineColor(int color)
Sets the color of the zero line
|
void |
setZeroLineWidth(float width)
Sets the width of the zero line in dp
|
addLimitLine, disableAxisLineDashedLine, disableGridDashedLine, enableAxisLineDashedLine, enableGridDashedLine, getAxisLineColor, getAxisLineDashPathEffect, getAxisLineWidth, getAxisMaximum, getAxisMaxLabels, getAxisMinimum, getAxisMinLabels, getFormattedLabel, getGranularity, getGridColor, getGridDashPathEffect, getGridLineWidth, getLabelCount, getLimitLines, getLongestLabel, getSpaceMax, getSpaceMin, getValueFormatter, isAxisLineDashedLineEnabled, isAxisMaxCustom, isAxisMinCustom, isCenterAxisLabelsEnabled, isDrawAxisLineEnabled, isDrawGridLinesBehindDataEnabled, isDrawGridLinesEnabled, isDrawLabelsEnabled, isDrawLimitLinesBehindDataEnabled, isForceLabelsEnabled, isGranularityEnabled, isGridDashedLineEnabled, removeAllLimitLines, removeLimitLine, resetAxisMaximum, resetAxisMinimum, setAxisLineColor, setAxisLineDashedLine, setAxisLineWidth, setAxisMaximum, setAxisMaxLabels, setAxisMaxValue, setAxisMinimum, setAxisMinLabels, setAxisMinValue, setCenterAxisLabels, setDrawAxisLine, setDrawGridLines, setDrawGridLinesBehindData, setDrawLabels, setDrawLimitLinesBehindData, setGranularity, setGranularityEnabled, setGridColor, setGridDashedLine, setGridLineWidth, setLabelCount, setLabelCount, setSpaceMax, setSpaceMin, setValueFormattergetTextColor, getTextSize, getTypeface, getXOffset, getYOffset, isEnabled, setEnabled, setTextColor, setTextSize, setTypeface, setXOffset, setYOffsetprotected boolean mInverted
protected boolean mDrawZeroLine
protected int mZeroLineColor
protected float mZeroLineWidth
protected float mSpacePercentTop
protected float mSpacePercentBottom
protected float mMinWidth
protected float mMaxWidth
public YAxis()
public YAxis(YAxis.AxisDependency position)
public YAxis.AxisDependency getAxisDependency()
public float getMinWidth()
public void setMinWidth(float minWidth)
minWidth - public float getMaxWidth()
public void setMaxWidth(float maxWidth)
maxWidth - public YAxis.YAxisLabelPosition getLabelPosition()
public void setPosition(YAxis.YAxisLabelPosition pos)
pos - public float getLabelXOffset()
public void setLabelXOffset(float xOffset)
xOffset - public boolean isDrawTopYLabelEntryEnabled()
public boolean isDrawBottomYLabelEntryEnabled()
public void setDrawTopYLabelEntry(boolean enabled)
enabled - public void setInverted(boolean enabled)
enabled - public boolean isInverted()
@Deprecated public void setStartAtZero(boolean startAtZero)
startAtZero - public void setSpaceTop(float percent)
percent - public float getSpaceTop()
public void setSpaceBottom(float percent)
percent - public float getSpaceBottom()
public boolean isDrawZeroLineEnabled()
public void setDrawZeroLine(boolean mDrawZeroLine)
mDrawZeroLine - public int getZeroLineColor()
public void setZeroLineColor(int color)
color - public float getZeroLineWidth()
public void setZeroLineWidth(float width)
width - public float getRequiredWidthSpace(android.graphics.Paint p)
p - public float getRequiredHeightSpace(android.graphics.Paint p)
p - public boolean needsOffset()
@Deprecated public boolean isUseAutoScaleMinRestriction()
@Deprecated public void setUseAutoScaleMinRestriction(boolean isEnabled)
@Deprecated public boolean isUseAutoScaleMaxRestriction()
@Deprecated public void setUseAutoScaleMaxRestriction(boolean isEnabled)
public void calculate(float dataMin,
float dataMax)
AxisBase