public abstract class AxisBase extends ComponentBase
| Modifier and Type | Field and Description |
|---|---|
float |
mAxisMaximum
don't touch this direclty, use setter
|
float |
mAxisMinimum
don't touch this directly, use setter
|
float |
mAxisRange
the total range of values this axis covers
|
protected boolean |
mCustomAxisMax
flag indicating that the axis-max value has been customized
|
protected boolean |
mCustomAxisMin
flag indicating that the axis-min value has been customized
|
protected boolean |
mDrawAxisLine
flag that indicates if the line alongside the axis is drawn or not
|
protected boolean |
mDrawGridLines
flag indicating if the grid lines for this axis should be drawn
|
protected boolean |
mDrawLabels
flag that indicates of the labels of this axis should be drawn or not
|
protected boolean |
mDrawLimitLineBehindData
flag indicating the limit lines layer depth
|
protected java.util.List<LimitLine> |
mLimitLines
array of limit lines that can be set for the axis
|
mEnabled, mTextColor, mTextSize, mTypeface, mXOffset, mYOffset| Constructor and Description |
|---|
AxisBase()
default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLimitLine(LimitLine l)
Adds a new LimitLine to this axis.
|
void |
disableGridDashedLine()
Disables the grid line to be drawn in dashed mode.
|
void |
enableGridDashedLine(float lineLength,
float spaceLength,
float phase)
Enables the grid line to be drawn in dashed mode, e.g.
|
int |
getAxisLineColor()
Returns the color of the axis line (line alongside the axis).
|
float |
getAxisLineWidth()
Returns the width of the axis line (line alongside the axis).
|
float |
getAxisMaximum()
###### BELOW CODE RELATED TO CUSTOM AXIS VALUES ######
|
float |
getAxisMinimum() |
int |
getGridColor()
Returns the color of the grid lines for this axis (the horizontal lines
coming from each label).
|
android.graphics.DashPathEffect |
getGridDashPathEffect()
returns the DashPathEffect that is set for grid line
|
float |
getGridLineWidth()
Returns the width of the grid lines that are drawn away from each axis
label.
|
java.util.List<LimitLine> |
getLimitLines()
Returns the LimitLines of this axis.
|
abstract java.lang.String |
getLongestLabel()
Returns the longest formatted label (in terms of characters), this axis
contains.
|
boolean |
isAxisMaxCustom()
Returns true if the axis max value has been customized (and is not calculated automatically)
|
boolean |
isAxisMinCustom()
Returns true if the axis min value has been customized (and is not calculated automatically)
|
boolean |
isDrawAxisLineEnabled()
Returns true if the line alongside the axis should be drawn.
|
boolean |
isDrawGridLinesEnabled()
Returns true if drawing grid lines is enabled for this axis.
|
boolean |
isDrawLabelsEnabled()
Returns true if drawing the labels is enabled for this axis.
|
boolean |
isDrawLimitLinesBehindDataEnabled() |
boolean |
isGridDashedLineEnabled()
Returns true if the grid dashed-line effect is enabled, false if not.
|
void |
removeAllLimitLines()
Removes all LimitLines from the axis.
|
void |
removeLimitLine(LimitLine l)
Removes the specified LimitLine from the axis.
|
void |
resetAxisMaxValue()
By calling this method, any custom maximum value that has been previously set is reseted,
and the calculation is
done automatically.
|
void |
resetAxisMinValue()
By calling this method, any custom minimum value that has been previously set is reseted,
and the calculation is
done automatically.
|
void |
setAxisLineColor(int color)
Sets the color of the border surrounding the chart.
|
void |
setAxisLineWidth(float width)
Sets the width of the border surrounding the chart in dp.
|
void |
setAxisMaxValue(float max)
Set a custom maximum value for this axis.
|
void |
setAxisMinValue(float min)
Set a custom minimum value for this axis.
|
void |
setDrawAxisLine(boolean enabled)
Set this to true if the line alongside the axis should be drawn or not.
|
void |
setDrawGridLines(boolean enabled)
Set this to true to enable drawing the grid lines for this axis.
|
void |
setDrawLabels(boolean enabled)
Set this to true to enable drawing the labels of this axis (this will not
affect drawing the grid lines or axis lines).
|
void |
setDrawLimitLinesBehindData(boolean enabled)
If this is set to true, the LimitLines are drawn behind the actual data,
otherwise on top.
|
void |
setGridColor(int color)
Sets the color of the grid lines for this axis (the horizontal lines
coming from each label).
|
void |
setGridLineWidth(float width)
Sets the width of the grid lines that are drawn away from each axis
label.
|
getTextColor, getTextSize, getTypeface, getXOffset, getYOffset, isEnabled, setEnabled, setTextColor, setTextSize, setTypeface, setXOffset, setYOffsetprotected boolean mDrawGridLines
protected boolean mDrawAxisLine
protected boolean mDrawLabels
protected java.util.List<LimitLine> mLimitLines
protected boolean mDrawLimitLineBehindData
protected boolean mCustomAxisMin
protected boolean mCustomAxisMax
public float mAxisMaximum
public float mAxisMinimum
public float mAxisRange
public void setDrawGridLines(boolean enabled)
enabled - public boolean isDrawGridLinesEnabled()
public void setDrawAxisLine(boolean enabled)
enabled - public boolean isDrawAxisLineEnabled()
public void setGridColor(int color)
color - public int getGridColor()
public void setAxisLineWidth(float width)
width - public float getAxisLineWidth()
public void setGridLineWidth(float width)
width - public float getGridLineWidth()
public void setAxisLineColor(int color)
color - public int getAxisLineColor()
public void setDrawLabels(boolean enabled)
enabled - public boolean isDrawLabelsEnabled()
public void addLimitLine(LimitLine l)
l - public void removeLimitLine(LimitLine l)
l - public void removeAllLimitLines()
public java.util.List<LimitLine> getLimitLines()
public void setDrawLimitLinesBehindData(boolean enabled)
enabled - public boolean isDrawLimitLinesBehindDataEnabled()
public abstract java.lang.String getLongestLabel()
public void enableGridDashedLine(float lineLength,
float spaceLength,
float phase)
lineLength - the length of the line piecesspaceLength - the length of space in between the piecesphase - offset, in degrees (normally, use 0)public void disableGridDashedLine()
public boolean isGridDashedLineEnabled()
public android.graphics.DashPathEffect getGridDashPathEffect()
public float getAxisMaximum()
public float getAxisMinimum()
public void resetAxisMaxValue()
public boolean isAxisMaxCustom()
public void resetAxisMinValue()
public boolean isAxisMinCustom()
public void setAxisMinValue(float min)
min - public void setAxisMaxValue(float max)
max -