Search in sources :

Example 1 with ChartHighlighter

use of com.github.mikephil.charting.highlight.ChartHighlighter in project MPAndroidChart by PhilJay.

the class BarLineChartBase method init.

@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);
    // light
    mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240));
    // grey
    mBorderPaint = new Paint();
    mBorderPaint.setStyle(Style.STROKE);
    mBorderPaint.setColor(Color.BLACK);
    mBorderPaint.setStrokeWidth(Utils.convertDpToPixel(1f));
}
Also used : Transformer(com.github.mikephil.charting.utils.Transformer) ChartHighlighter(com.github.mikephil.charting.highlight.ChartHighlighter) YAxisRenderer(com.github.mikephil.charting.renderer.YAxisRenderer) Paint(android.graphics.Paint) XAxisRenderer(com.github.mikephil.charting.renderer.XAxisRenderer) YAxis(com.github.mikephil.charting.components.YAxis) BarLineChartTouchListener(com.github.mikephil.charting.listener.BarLineChartTouchListener)

Aggregations

Paint (android.graphics.Paint)1 YAxis (com.github.mikephil.charting.components.YAxis)1 ChartHighlighter (com.github.mikephil.charting.highlight.ChartHighlighter)1 BarLineChartTouchListener (com.github.mikephil.charting.listener.BarLineChartTouchListener)1 XAxisRenderer (com.github.mikephil.charting.renderer.XAxisRenderer)1 YAxisRenderer (com.github.mikephil.charting.renderer.YAxisRenderer)1 Transformer (com.github.mikephil.charting.utils.Transformer)1