Search in sources :

Example 1 with BarLineChartTouchListener

use of com.github.mikephil.charting.listener.BarLineChartTouchListener in project carat by amplab.

the class BarLineChartBase method init.

@Override
protected void init() {
    super.init();
    mListener = new BarLineChartTouchListener(this, mTrans.getTouchMatrix());
    mGridPaint = new Paint();
    mGridPaint.setColor(Color.GRAY);
    mGridPaint.setStrokeWidth(mGridWidth);
    mGridPaint.setStyle(Style.STROKE);
    mGridPaint.setAlpha(90);
    mBorderPaint = new Paint();
    mBorderPaint.setColor(Color.BLACK);
    mBorderPaint.setStrokeWidth(mGridWidth * 2f);
    mBorderPaint.setStyle(Style.STROKE);
    mGridBackgroundPaint = new Paint();
    mGridBackgroundPaint.setStyle(Style.FILL);
    // mGridBackgroundPaint.setColor(Color.WHITE);
    // light
    mGridBackgroundPaint.setColor(Color.rgb(240, 240, 240));
// grey
}
Also used : Paint(android.graphics.Paint) BarLineChartTouchListener(com.github.mikephil.charting.listener.BarLineChartTouchListener)

Example 2 with BarLineChartTouchListener

use of com.github.mikephil.charting.listener.BarLineChartTouchListener 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)2 BarLineChartTouchListener (com.github.mikephil.charting.listener.BarLineChartTouchListener)2 YAxis (com.github.mikephil.charting.components.YAxis)1 ChartHighlighter (com.github.mikephil.charting.highlight.ChartHighlighter)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