com.github.mikephil.charting.highlight.ChartHighlighter Java Examples

The following examples show how to use com.github.mikephil.charting.highlight.ChartHighlighter. 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: 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 #3
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 #4
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 #5
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 #6
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 #7
Source File: Chart.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
public ChartHighlighter getHighlighter() {
    return mHighlighter;
}
 
Example #8
Source File: Chart.java    From NetKnight with Apache License 2.0 4 votes vote down vote up
public ChartHighlighter getHighlighter() {
    return mHighlighter;
}
 
Example #9
Source File: Chart.java    From StockChart-MPAndroidChart with MIT License 2 votes vote down vote up
/**
 * Sets a custom highligher object for the chart that handles / processes
 * all highlight touch events performed on the chart-view.
 *
 * @param highlighter
 */
public void setHighlighter(ChartHighlighter highlighter) {
    mHighlighter = highlighter;
}
 
Example #10
Source File: Chart.java    From Ticket-Analysis with MIT License 2 votes vote down vote up
/**
 * Sets a custom highligher object for the chart that handles / processes
 * all highlight touch events performed on the chart-view.
 *
 * @param highlighter
 */
public void setHighlighter(ChartHighlighter highlighter) {
    mHighlighter = highlighter;
}
 
Example #11
Source File: Chart.java    From android-kline with Apache License 2.0 2 votes vote down vote up
/**
 * Sets a custom highligher object for the chart that handles / processes
 * all highlight touch events performed on the chart-view.
 *
 * @param highlighter
 */
public void setHighlighter(ChartHighlighter highlighter) {
    mHighlighter = highlighter;
}
 
Example #12
Source File: Chart.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * Sets a custom highligher object for the chart that handles / processes
 * all highlight touch events performed on the chart-view.
 *
 * @param highlighter
 */
public void setHighlighter(ChartHighlighter highlighter) {

    mHighlighter = highlighter;
}
 
Example #13
Source File: Chart.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * Sets a custom highligher object for the chart that handles / processes
 * all highlight touch events performed on the chart-view.
 *
 * @param highlighter
 */
public void setHighlighter(ChartHighlighter highlighter) {

    mHighlighter = highlighter;
}