-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
The Axis
Philipp Jahoda edited this page Apr 5, 2015
·
15 revisions
This wiki page focuses on the AxisBase class, the baseclass of both XAxis and YAxis.
The following methods mentioned below can be applied to both axes.
The axis classes allow specific styling and consist (can consist) of the following components/parts:
- The labels (drawn in vertical (y-axis) or horizontal (x-axis) alignment), which contain the axis description values
- A so called "axis-line" that is drawn directly next to and parallel to the labels
- The "grid-lines", each originating from an axis-label in horizontal direction
-
LimitLines, that allow to present special infomation, like borders or constraints
Control which parts (of the axis) should be drawn
-
setEnabled(boolean enabled): Sets the axis enabled or disabled. If disabled, no part of the axis will be drawn. -
setDrawAxisLine(boolean enabled): Set this to true if the line alongside the axis (axis-line) should be drawn or not. -
setDrawGridLines(boolean enabled): Set this to true to enable drawing the grid lines for the axis. -
setDrawLabels(boolean enabled): Set this to true to enable drawing the labels of the axis.
Styling / modifying the axis
-
setTextColor(int color): Sets the color of the axis labels. -
setTextSize(float size): Sets the text-size of the axis labels in dp. -
setTypeface(Typeface tf): Sets a customTypefacefor the axis labels. -
setGridColor(int color): Sets the color of the grid-lines of this axis. -
setGridLineWidth(float width): Sets the width of the grid-lines of this axis. -
setAxisLineColor(int color): Sets the color of the axis-line of this axis. -
setAxisLineWidth(float width): Sets the width of the axis-line of this axis. -
enableGridDashedLine(float lineLength, float spaceLength, float phase): Enables the grid line to be drawn in dashed mode, e.g. like this "- - - - - -". "lineLength" controls the length of the line pieces, "spaceLength" controls the space between the lines, "phase" controls the starting point.