public class XAxis extends AxisBase
| Modifier and Type | Class and Description |
|---|---|
static class |
XAxis.XAxisPosition
enum for the position of the x-labels relative to the chart
|
| Modifier and Type | Field and Description |
|---|---|
int |
mAxisLabelModulus
the modulus that indicates if a value at a specified index in an
array(list) for the x-axis-labels is drawn or not.
|
int |
mLabelHeight
height of the x-axis labels in pixels - this is automatically
calculated by the computeAxis() methods in the renderers
|
int |
mLabelRotatedHeight
height of the (rotated) x-axis labels in pixels - this is automatically
calculated by the computeAxis() methods in the renderers
|
int |
mLabelRotatedWidth
width of the (rotated) x-axis labels in pixels - this is automatically
calculated by the computeAxis() methods in the renderers
|
protected float |
mLabelRotationAngle
This is the angle for drawing the X axis labels (in degrees)
|
int |
mLabelWidth
width of the x-axis labels in pixels - this is automatically
calculated by the computeAxis() methods in the renderers
|
protected java.util.List<java.lang.String> |
mValues
the arraylist containing all the x-axis labels
|
protected XAxisValueFormatter |
mXAxisValueFormatter
Custom formatter for adjusting x-value strings
|
mDrawAxisLine, mDrawGridLines, mDrawLabels, mDrawLimitLineBehindData, mLimitLinesmEnabled, mTextColor, mTextSize, mTypeface, mXOffset, mYOffset| Constructor and Description |
|---|
XAxis() |
| Modifier and Type | Method and Description |
|---|---|
float |
getLabelRotationAngle()
returns the angle for drawing the X axis labels (in degrees)
|
java.lang.String |
getLongestLabel()
Returns the longest formatted label (in terms of characters), this axis
contains.
|
XAxis.XAxisPosition |
getPosition()
returns the position of the x-labels
|
int |
getSpaceBetweenLabels()
Returns the space (in characters) that should be left out between the
x-axis labels
|
XAxisValueFormatter |
getValueFormatter()
Returns the custom XAxisValueFormatter that is set for this data object.
|
java.util.List<java.lang.String> |
getValues()
Returns the labels for this axis.
|
boolean |
isAvoidFirstLastClippingEnabled()
returns true if avoid-first-lastclipping is enabled, false if not
|
boolean |
isAxisModulusCustom()
Returns true if a custom axis-modulus has been set that determines the
number of labels to skip when drawing.
|
void |
resetLabelsToSkip()
Calling this will disable a custom number of labels to be skipped (set by
setLabelsToSkip(...)) while drawing the x-axis.
|
void |
setAvoidFirstLastClipping(boolean enabled)
if set to true, the chart will avoid that the first and last label entry
in the chart "clip" off the edge of the chart or the screen
|
void |
setLabelRotationAngle(float angle)
sets the angle for drawing the X axis labels (in degrees)
|
void |
setLabelsToSkip(int count)
Sets the number of labels that should be skipped on the axis before the
next label is drawn.
|
void |
setPosition(XAxis.XAxisPosition pos)
sets the position of the x-labels
|
void |
setSpaceBetweenLabels(int spaceCharacters)
Sets the space (in characters) that should be left out between the x-axis
labels, default 4.
|
void |
setValueFormatter(XAxisValueFormatter formatter)
Sets a custom XAxisValueFormatter for the data object that allows custom-formatting
of all x-values before rendering them.
|
void |
setValues(java.util.List<java.lang.String> values)
Sets the labels for this axis.
|
addLimitLine, disableGridDashedLine, enableGridDashedLine, getAxisLineColor, getAxisLineWidth, getGridColor, getGridDashPathEffect, getGridLineWidth, getLimitLines, isDrawAxisLineEnabled, isDrawGridLinesEnabled, isDrawLabelsEnabled, isDrawLimitLinesBehindDataEnabled, isGridDashedLineEnabled, removeAllLimitLines, removeLimitLine, setAxisLineColor, setAxisLineWidth, setDrawAxisLine, setDrawGridLines, setDrawLabels, setDrawLimitLinesBehindData, setGridColor, setGridLineWidthgetTextColor, getTextSize, getTypeface, getXOffset, getYOffset, isEnabled, setEnabled, setTextColor, setTextSize, setTypeface, setXOffset, setYOffsetprotected java.util.List<java.lang.String> mValues
public int mLabelWidth
public int mLabelHeight
public int mLabelRotatedWidth
public int mLabelRotatedHeight
protected float mLabelRotationAngle
public int mAxisLabelModulus
protected XAxisValueFormatter mXAxisValueFormatter
public XAxis.XAxisPosition getPosition()
public void setPosition(XAxis.XAxisPosition pos)
pos - public float getLabelRotationAngle()
public void setLabelRotationAngle(float angle)
angle - the angle in degreespublic void setSpaceBetweenLabels(int spaceCharacters)
spaceCharacters - public void setLabelsToSkip(int count)
count - public void resetLabelsToSkip()
public boolean isAxisModulusCustom()
public int getSpaceBetweenLabels()
public void setAvoidFirstLastClipping(boolean enabled)
enabled - public boolean isAvoidFirstLastClippingEnabled()
public void setValues(java.util.List<java.lang.String> values)
values - public java.util.List<java.lang.String> getValues()
public void setValueFormatter(XAxisValueFormatter formatter)
formatter - public XAxisValueFormatter getValueFormatter()
public java.lang.String getLongestLabel()
AxisBasegetLongestLabel in class AxisBase