use of com.github.mikephil.charting.renderer.LegendRenderer in project MPAndroidChart by PhilJay.
the class Chart method init.
/**
* initialize all paints and stuff
*/
protected void init() {
setWillNotDraw(false);
if (android.os.Build.VERSION.SDK_INT < 11)
mAnimator = new ChartAnimator();
else
mAnimator = new ChartAnimator(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
// ViewCompat.postInvalidateOnAnimation(Chart.this);
postInvalidate();
}
});
// initialize the utils
Utils.init(getContext());
mMaxHighlightDistance = Utils.convertDpToPixel(500f);
mDescription = new Description();
mLegend = new Legend();
mLegendRenderer = new LegendRenderer(mViewPortHandler, mLegend);
mXAxis = new XAxis();
mDescPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mInfoPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
// orange
mInfoPaint.setColor(Color.rgb(247, 189, 51));
mInfoPaint.setTextAlign(Align.CENTER);
mInfoPaint.setTextSize(Utils.convertDpToPixel(12f));
if (mLogEnabled)
Log.i("", "Chart.init()");
}
Aggregations