Android Open Source - Thrift-box X Labels






From Project

Back to project page Thrift-box.

License

The source code is released under:

GNU General Public License

If you think the Android project Thrift-box listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.github.mikephil.charting.utils;
//w  ww .  j  a  v a  2  s  .c  o  m
/**
 * Class representing the x-axis labels settings. Only use the setter methods to
 * modify it. Do not access public variables directly. Be aware that not all
 * features the XLabels class provides are suitable for the RadarChart.
 * 
 * @author Philipp Jahoda
 */
public class XLabels extends LabelBase {

    /**
     * width of the x-axis labels in pixels - this is calculated by the
     * calcTextWidth() method of the utils
     */
    public int mLabelWidth = 1;

    /**
     * height of the x-axis labels in pixels - this is calculated by the
     * calcTextHeight() method of the utils
     */
    public int mLabelHeight = 1;

    /**
     * the space that should be left out (in characters) between the x-axis
     * labels
     */
    private int mSpaceBetweenLabels = 4;

    /**
     * the modulus that indicates if a value at a specified index in an
     * array(list) for the x-axis-labels is drawn or not. If index % modulus ==
     * 0 DRAW, else dont draw.
     */
    public int mXAxisLabelModulus = 1;
    
    /**
     * the modulus that indicates if a value at a specified index in an
     * array(list) for the y-axis-labels is drawn or not. If index % modulus ==
     * 0 DRAW, else dont draw. THIS IS ONLY FOR HORIZONTAL BARCHART.
     */
    public int mYAxisLabelModulus = 1;

    /** if true, x-axis label text is centered when using barcharts */
    private boolean mCenterXAxisLabels = false;

    /**
     * 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
     */
    private boolean mAvoidFirstLastClipping = false;

    /**
     * if set to true, the x-axis label entries will adjust themselves when
     * scaling the graph
     */
    protected boolean mAdjustXAxisLabels = true;

    /** the position of the x-labels relative to the chart */
    private XLabelPosition mPosition = XLabelPosition.TOP;

    /** enum for the position of the x-labels relative to the chart */
    public enum XLabelPosition {
        TOP, BOTTOM, BOTH_SIDED, TOP_INSIDE, BOTTOM_INSIDE
    }

    /**
     * returns true if centering x-axis labels when using barcharts is enabled,
     * false if not
     * 
     * @return
     */
    public boolean isCenterXLabelsEnabled() {
        return mCenterXAxisLabels;
    }

    /**
     * set this to true to center the x-label text when using barcharts ,
     * default: false
     * 
     * @param enabled
     */
    public void setCenterXLabelText(boolean enabled) {
        mCenterXAxisLabels = enabled;
    }

    /**
     * if set to true, the x-label entries will adjust themselves when scaling
     * the graph default: true
     * 
     * @param enabled
     */
    public void setAdjustXLabels(boolean enabled) {
        mAdjustXAxisLabels = enabled;
    }

    /**
     * returns true if the x-labels adjust themselves when scaling the graph,
     * false if not
     * 
     * @return
     */
    public boolean isAdjustXLabelsEnabled() {
        return mAdjustXAxisLabels;
    }

    /**
     * returns the position of the x-labels
     */
    public XLabelPosition getPosition() {
        return mPosition;
    }

    /**
     * sets the position of the x-labels
     * 
     * @param pos
     */
    public void setPosition(XLabelPosition pos) {
        mPosition = pos;
    }

    /**
     * Sets the space (in characters) that should be left out between the x-axis
     * labels, default 4
     * 
     * @param space
     */
    public void setSpaceBetweenLabels(int space) {
        mSpaceBetweenLabels = space;
    }

    /**
     * Returns the space (in characters) that should be left out between the
     * x-axis labels
     * 
     * @param space
     */
    public int getSpaceBetweenLabels() {
        return mSpaceBetweenLabels;
    }

    /**
     * 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
     * 
     * @param enabled
     */
    public void setAvoidFirstLastClipping(boolean enabled) {
        mAvoidFirstLastClipping = enabled;
    }

    /**
     * returns true if avoid-first-lastclipping is enabled, false if not
     * 
     * @return
     */
    public boolean isAvoidFirstLastClippingEnabled() {
        return mAvoidFirstLastClipping;
    }
}




Java Source Code List

android.support.v4.preference.PreferenceFragment.java
android.support.v4.preference.PreferenceManagerCompat.java
android.widget_fixed.CursorFilter.java
android.widget_fixed.CursorTreeAdapter.java
com.github.mikephil.charting.charts.Chart.java
com.github.mikephil.charting.charts.PieChart.java
com.github.mikephil.charting.charts.PieRadarChartBase.java
com.github.mikephil.charting.data.ChartData.java
com.github.mikephil.charting.data.DataSet.java
com.github.mikephil.charting.data.Entry.java
com.github.mikephil.charting.data.PieDataSet.java
com.github.mikephil.charting.data.PieData.java
com.github.mikephil.charting.data.filter.Approximator.java
com.github.mikephil.charting.exception.DrawingDataSetNotCreatedException.java
com.github.mikephil.charting.interfaces.ChartInterface.java
com.github.mikephil.charting.interfaces.OnChartGestureListener.java
com.github.mikephil.charting.interfaces.OnChartValueSelectedListener.java
com.github.mikephil.charting.interfaces.OnDrawLineChartTouchListener.java
com.github.mikephil.charting.interfaces.OnDrawListener.java
com.github.mikephil.charting.listener.PieRadarChartTouchListener.java
com.github.mikephil.charting.matrix.Vector3.java
com.github.mikephil.charting.renderer.Transformer.java
com.github.mikephil.charting.utils.ColorFormatter.java
com.github.mikephil.charting.utils.ColorTemplate.java
com.github.mikephil.charting.utils.Highlight.java
com.github.mikephil.charting.utils.LabelBase.java
com.github.mikephil.charting.utils.LargeValueFormatter.java
com.github.mikephil.charting.utils.Legend.java
com.github.mikephil.charting.utils.LimitLine.java
com.github.mikephil.charting.utils.MarkerView.java
com.github.mikephil.charting.utils.PointD.java
com.github.mikephil.charting.utils.SelInfo.java
com.github.mikephil.charting.utils.Utils.java
com.github.mikephil.charting.utils.ValueFormatter.java
com.github.mikephil.charting.utils.XLabels.java
com.github.mikephil.charting.utils.YLabels.java
net.margaritov.preference.colorpicker.AlphaPatternDrawable.java
net.margaritov.preference.colorpicker.ColorPickerDialog.java
net.margaritov.preference.colorpicker.ColorPickerPanelView.java
net.margaritov.preference.colorpicker.ColorPickerPreference.java
net.margaritov.preference.colorpicker.ColorPickerView.java
ru.sash0k.thriftbox.AdapterExpenses.java
ru.sash0k.thriftbox.MainActivity.java
ru.sash0k.thriftbox.TypefaceSpan2.java
ru.sash0k.thriftbox.Utils.java
ru.sash0k.thriftbox.Widget.java
ru.sash0k.thriftbox.categories.Categories.java
ru.sash0k.thriftbox.categories.InterceptingHorizontalScrollView.java
ru.sash0k.thriftbox.database.DBProvider.java
ru.sash0k.thriftbox.database.DB.java
ru.sash0k.thriftbox.fragments.CommentDialog.java
ru.sash0k.thriftbox.fragments.DeleteConfirmDialog.java
ru.sash0k.thriftbox.fragments.ExpandableListFragment.java
ru.sash0k.thriftbox.fragments.ExpensesFragment.java
ru.sash0k.thriftbox.fragments.InputFragment.java
ru.sash0k.thriftbox.fragments.PieChartFragment.java
ru.sash0k.thriftbox.fragments.SettingsFragment.java