Java Code Examples for com.github.mikephil.charting.components.YAxis.AxisDependency#RIGHT

The following examples show how to use com.github.mikephil.charting.components.YAxis.AxisDependency#RIGHT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BarLineChartBase.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
@Override
    protected void init() {
        super.init();

        mAxisLeft = new YAxis(AxisDependency.LEFT);
        mAxisRight = new YAxis(AxisDependency.RIGHT);

        mLeftAxisTransformer = new Transformer(mViewPortHandler);
        mRightAxisTransformer = new Transformer(mViewPortHandler);

        mAxisRendererLeft = new YAxisRenderer(mViewPortHandler, mAxisLeft, mLeftAxisTransformer);
        mAxisRendererRight = new YAxisRenderer(mViewPortHandler, mAxisRight, mRightAxisTransformer);

        initXAxisRenderer();
//        mXAxisRenderer = new XAxisRenderer(mViewPortHandler, mXAxis, mLeftAxisTransformer);

        setHighlighter(new ChartHighlighter(this));

        mChartTouchListener = new BarLineChartTouchListener(this, mViewPortHandler.getMatrixTouch(), 3f);

        mGridBackgroundPaint = new Paint();
        mGridBackgroundPaint.setStyle(Style.FILL);
        // mGridBackgroundPaint.setColor(Color.WHITE);
        mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240)); // light
        // grey

        mBorderPaint = new Paint();
        mBorderPaint.setStyle(Style.STROKE);
        mBorderPaint.setColor(Color.BLACK);
        mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(1f));
    }
 
Example 2
Source File: ChartData.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
/**
 * Returns the first DataSet from the datasets-array that has it's dependency on the right axis.
 * Returns null if no DataSet with right dependency could be found.
 *
 * @return
 */
public T getFirstRight(List<T> sets) {
    for (T dataSet : sets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT) {
            return dataSet;
        }
    }
    return null;
}
 
Example 3
Source File: BarLineChartBase.java    From Ticket-Analysis with MIT License 5 votes vote down vote up
@Override
protected void init() {
    super.init();

    mAxisLeft = new YAxis(AxisDependency.LEFT);
    mAxisRight = new YAxis(AxisDependency.RIGHT);

    mLeftAxisTransformer = new Transformer(mViewPortHandler);
    mRightAxisTransformer = new Transformer(mViewPortHandler);

    mAxisRendererLeft = new YAxisRenderer(mViewPortHandler, mAxisLeft, mLeftAxisTransformer);
    mAxisRendererRight = new YAxisRenderer(mViewPortHandler, mAxisRight, mRightAxisTransformer);

    mXAxisRenderer = new XAxisRenderer(mViewPortHandler, mXAxis, mLeftAxisTransformer);

    setHighlighter(new ChartHighlighter(this));

    mChartTouchListener = new BarLineChartTouchListener(this, mViewPortHandler.getMatrixTouch(), 3f);

    mGridBackgroundPaint = new Paint();
    mGridBackgroundPaint.setStyle(Style.FILL);
    // mGridBackgroundPaint.setColor(Color.WHITE);
    mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240)); // light
    // grey

    mBorderPaint = new Paint();
    mBorderPaint.setStyle(Style.STROKE);
    mBorderPaint.setColor(Color.BLACK);
    mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(1f));
}
 
Example 4
Source File: ChartData.java    From Ticket-Analysis with MIT License 5 votes vote down vote up
/**
 * Returns the first DataSet from the datasets-array that has it's dependency on the right axis.
 * Returns null if no DataSet with right dependency could be found.
 *
 * @return
 */
public T getFirstRight(List<T> sets) {
    for (T dataSet : sets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT)
            return dataSet;
    }
    return null;
}
 
Example 5
Source File: BarLineChartBase.java    From android-kline with Apache License 2.0 5 votes vote down vote up
@Override
protected void init() {
    super.init();

    mAxisLeft = new YAxis(AxisDependency.LEFT);
    mAxisRight = new YAxis(AxisDependency.RIGHT);

    mLeftAxisTransformer = new Transformer(mViewPortHandler);
    mRightAxisTransformer = new Transformer(mViewPortHandler);

    mAxisRendererLeft = new YAxisRenderer(mViewPortHandler, mAxisLeft, mLeftAxisTransformer);
    mAxisRendererRight = new YAxisRenderer(mViewPortHandler, mAxisRight, mRightAxisTransformer);

    mXAxisRenderer = new XAxisRenderer(mViewPortHandler, mXAxis, mLeftAxisTransformer);

    setHighlighter(new ChartHighlighter(this));

    mChartTouchListener = new BarLineChartTouchListener(this, mViewPortHandler.getMatrixTouch(), 3f);

    mGridBackgroundPaint = new Paint();
    mGridBackgroundPaint.setStyle(Style.FILL);
    // mGridBackgroundPaint.setColor(Color.WHITE);
    mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240)); // light
    // grey

    mBorderPaint = new Paint();
    mBorderPaint.setStyle(Style.STROKE);
    mBorderPaint.setColor(Color.BLACK);
    mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(1f));
}
 
Example 6
Source File: ChartData.java    From android-kline with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the first DataSet from the datasets-array that has it's dependency on the right axis.
 * Returns null if no DataSet with right dependency could be found.
 *
 * @return
 */
public T getFirstRight(List<T> sets) {
    for (T dataSet : sets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT)
            return dataSet;
    }
    return null;
}
 
Example 7
Source File: BarLineChartBase.java    From iMoney with Apache License 2.0 5 votes vote down vote up
@Override
protected void init() {
    super.init();

    mAxisLeft = new YAxis(AxisDependency.LEFT);
    mAxisRight = new YAxis(AxisDependency.RIGHT);

    mXAxis = new XAxis();

    mLeftAxisTransformer = new Transformer(mViewPortHandler);
    mRightAxisTransformer = new Transformer(mViewPortHandler);

    mAxisRendererLeft = new YAxisRenderer(mViewPortHandler, mAxisLeft, mLeftAxisTransformer);
    mAxisRendererRight = new YAxisRenderer(mViewPortHandler, mAxisRight, mRightAxisTransformer);

    mXAxisRenderer = new XAxisRenderer(mViewPortHandler, mXAxis, mLeftAxisTransformer);

    mHighlighter = new ChartHighlighter(this);

    mChartTouchListener = new BarLineChartTouchListener(this, mViewPortHandler.getMatrixTouch());

    mGridBackgroundPaint = new Paint();
    mGridBackgroundPaint.setStyle(Style.FILL);
    // mGridBackgroundPaint.setColor(Color.WHITE);
    mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240)); // light
    // grey

    mBorderPaint = new Paint();
    mBorderPaint.setStyle(Style.STROKE);
    mBorderPaint.setColor(Color.BLACK);
    mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(1f));
}
 
Example 8
Source File: ChartData.java    From iMoney with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the first DataSet from the datasets-array that has it's dependency on the right axis.
 * Returns null if no DataSet with right dependency could be found.
 *
 * @return
 */
public T getFirstRight() {
    for (T dataSet : mDataSets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT)
            return dataSet;
    }

    return null;
}
 
Example 9
Source File: BarLineChartBase.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
@Override
protected void init() {
    super.init();

    mAxisLeft = new YAxis(AxisDependency.LEFT);
    mAxisRight = new YAxis(AxisDependency.RIGHT);

    mXAxis = new XAxis();

    mLeftAxisTransformer = new Transformer(mViewPortHandler);
    mRightAxisTransformer = new Transformer(mViewPortHandler);

    mAxisRendererLeft = new YAxisRenderer(mViewPortHandler, mAxisLeft, mLeftAxisTransformer);
    mAxisRendererRight = new YAxisRenderer(mViewPortHandler, mAxisRight, mRightAxisTransformer);

    mXAxisRenderer = new XAxisRenderer(mViewPortHandler, mXAxis, mLeftAxisTransformer);

    setHighlighter(new ChartHighlighter(this));

    mChartTouchListener = new BarLineChartTouchListener(this, mViewPortHandler.getMatrixTouch());

    mGridBackgroundPaint = new Paint();
    mGridBackgroundPaint.setStyle(Style.FILL);
    // mGridBackgroundPaint.setColor(Color.WHITE);
    mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240)); // light
    // grey

    mBorderPaint = new Paint();
    mBorderPaint.setStyle(Style.STROKE);
    mBorderPaint.setColor(Color.BLACK);
    mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(1f));
}
 
Example 10
Source File: ChartData.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the first DataSet from the datasets-array that has it's dependency on the right axis.
 * Returns null if no DataSet with right dependency could be found.
 *
 * @return
 */
public T getFirstRight() {
    for (T dataSet : mDataSets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT)
            return dataSet;
    }

    return null;
}
 
Example 11
Source File: BarLineChartBase.java    From NetKnight with Apache License 2.0 5 votes vote down vote up
@Override
protected void init() {
    super.init();

    mAxisLeft = new YAxis(AxisDependency.LEFT);
    mAxisRight = new YAxis(AxisDependency.RIGHT);

    mLeftAxisTransformer = new Transformer(mViewPortHandler);
    mRightAxisTransformer = new Transformer(mViewPortHandler);

    mAxisRendererLeft = new YAxisRenderer(mViewPortHandler, mAxisLeft, mLeftAxisTransformer);
    mAxisRendererRight = new YAxisRenderer(mViewPortHandler, mAxisRight, mRightAxisTransformer);

    mXAxisRenderer = new XAxisRenderer(mViewPortHandler, mXAxis, mLeftAxisTransformer);

    setHighlighter(new ChartHighlighter(this));

    mChartTouchListener = new BarLineChartTouchListener(this, mViewPortHandler.getMatrixTouch());

    mGridBackgroundPaint = new Paint();
    mGridBackgroundPaint.setStyle(Style.FILL);
    // mGridBackgroundPaint.setColor(Color.WHITE);
    mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240)); // light
    // grey

    mBorderPaint = new Paint();
    mBorderPaint.setStyle(Style.STROKE);
    mBorderPaint.setColor(Color.BLACK);
    mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(1f));
}
 
Example 12
Source File: ChartData.java    From NetKnight with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the first DataSet from the datasets-array that has it's dependency on the right axis.
 * Returns null if no DataSet with right dependency could be found.
 *
 * @return
 */
public T getFirstRight() {
    for (T dataSet : mDataSets) {
        if (dataSet.getAxisDependency() == AxisDependency.RIGHT)
            return dataSet;
    }

    return null;
}