本文整理汇总了Java中com.github.mikephil.charting.utils.Transformer类的典型用法代码示例。如果您正苦于以下问题:Java Transformer类的具体用法?Java Transformer怎么用?Java Transformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Transformer类属于com.github.mikephil.charting.utils包,在下文中一共展示了Transformer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawCubicFill
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
protected void drawCubicFill(Canvas c, ILineDataSet dataSet, Path spline, Transformer trans, XBounds bounds) {
float fillMin = dataSet.getFillFormatter()
.getFillLinePosition(dataSet, mChart);
spline.lineTo(dataSet.getEntryForIndex(bounds.min + bounds.range).getX(), fillMin);
spline.lineTo(dataSet.getEntryForIndex(bounds.min).getX(), fillMin);
spline.close();
trans.pathValueToPixel(spline);
final Drawable drawable = dataSet.getFillDrawable();
if (drawable != null) {
drawFilledPath(c, spline, drawable);
} else {
drawFilledPath(c, spline, dataSet.getFillColor(), dataSet.getFillAlpha());
}
}
示例2: AxisRenderer
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public AxisRenderer(ViewPortHandler viewPortHandler, Transformer trans, AxisBase axis) {
super(viewPortHandler);
this.mTrans = trans;
this.mAxis = axis;
if(mViewPortHandler != null) {
mAxisLabelPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mGridPaint = new Paint();
mGridPaint.setColor(Color.GRAY);
mGridPaint.setStrokeWidth(1f);
mGridPaint.setStyle(Style.STROKE);
mGridPaint.setAlpha(90);
mAxisLinePaint = new Paint();
mAxisLinePaint.setColor(Color.BLACK);
mAxisLinePaint.setStrokeWidth(1f);
mAxisLinePaint.setStyle(Style.STROKE);
mLimitLinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mLimitLinePaint.setStyle(Paint.Style.STROKE);
}
}
示例3: YAxisRenderer
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public YAxisRenderer(ViewPortHandler viewPortHandler, YAxis yAxis, Transformer trans) {
super(viewPortHandler, trans, yAxis);
this.mYAxis = yAxis;
if(mViewPortHandler != null) {
mAxisLabelPaint.setColor(Color.BLACK);
mAxisLabelPaint.setTextSize(Utils.convertDpToPixel(10f));
mZeroLinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mZeroLinePaint.setColor(Color.GRAY);
mZeroLinePaint.setStrokeWidth(1f);
mZeroLinePaint.setStyle(Paint.Style.STROKE);
}
}
示例4: drawLinearFill
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
protected void drawLinearFill(Canvas c, ILineDataSet dataSet, int minx,
int maxx,
Transformer trans) {
Path filled = generateFilledPath(
dataSet, minx, maxx);
trans.pathValueToPixel(filled);
final Drawable drawable = dataSet.getFillDrawable();
if (drawable != null) {
drawFilledPath(c, filled, drawable);
} else {
drawFilledPath(c, filled, dataSet.getFillColor(), dataSet.getFillAlpha());
}
}
示例5: drawCubicFill
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
protected void drawCubicFill(Canvas c, ILineDataSet dataSet, Path spline, Transformer trans, XBounds bounds) {
float fillMin = dataSet.getFillFormatter()
.getFillLinePosition(dataSet, mChart);
spline.lineTo(bounds.min + bounds.range, fillMin);
spline.lineTo(bounds.min, fillMin);
spline.close();
trans.pathValueToPixel(spline);
final Drawable drawable = dataSet.getFillDrawable();
if (drawable != null) {
drawFilledPath(c, spline, drawable);
} else {
drawFilledPath(c, spline, dataSet.getFillColor(), dataSet.getFillAlpha());
}
}
示例6: init
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
@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));
}
示例7: drawLinearFill
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
/**
* Draws a filled linear path on the canvas.
*
* @param c
* @param dataSet
* @param trans
* @param bounds
*/
protected void drawLinearFill(Canvas c, ILineDataSet dataSet, Transformer trans, XBounds bounds) {
final Path filled = mGenerateFilledPathBuffer;
final int startingIndex = bounds.min;
final int endingIndex = bounds.range + bounds.min;
final int indexInterval = 128;
int currentStartIndex = 0;
int currentEndIndex = indexInterval;
int iterations = 0;
// Doing this iteratively in order to avoid OutOfMemory errors that can happen on large bounds sets.
do {
currentStartIndex = startingIndex + (iterations * indexInterval);
currentEndIndex = currentStartIndex + indexInterval;
currentEndIndex = currentEndIndex > endingIndex ? endingIndex : currentEndIndex;
if (currentStartIndex <= currentEndIndex) {
generateFilledPath(dataSet, currentStartIndex, currentEndIndex, filled);
trans.pathValueToPixel(filled);
final Drawable drawable = dataSet.getFillDrawable();
if (drawable != null) {
drawFilledPath(c, filled, drawable);
} else {
drawFilledPath(c, filled, dataSet.getFillColor(), dataSet.getFillAlpha());
}
}
iterations++;
} while (currentStartIndex <= currentEndIndex);
}
示例8: prepareBarHighlight
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
protected void prepareBarHighlight(float x, float y1, float y2, float barWidthHalf, Transformer trans) {
float left = x - barWidthHalf;
float right = x + barWidthHalf;
float top = y1;
float bottom = y2;
mBarRect.set(left, top, right, bottom);
trans.rectToPixelPhase(mBarRect, mAnimator.getPhaseY());
}
示例9: XAxisRenderer
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public XAxisRenderer(ViewPortHandler viewPortHandler, XAxis xAxis, Transformer trans) {
super(viewPortHandler, trans, xAxis);
this.mXAxis = xAxis;
mAxisLabelPaint.setColor(Color.BLACK);
mAxisLabelPaint.setTextAlign(Align.CENTER);
mAxisLabelPaint.setTextSize(Utils.convertDpToPixel(10f));
}
示例10: prepareBarHighlight
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
@Override
protected void prepareBarHighlight(float x, float y1, float y2, float barWidthHalf, Transformer trans) {
float top = x - barWidthHalf;
float bottom = x + barWidthHalf;
float left = y1;
float right = y2;
mBarRect.set(left, top, right, bottom);
trans.rectToPixelPhaseHorizontal(mBarRect, mAnimator.getPhaseY());
}
示例11: getInstance
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public static AnimatedMoveViewJob getInstance(ViewPortHandler viewPortHandler, float xValue, float yValue, Transformer trans, View v, float xOrigin, float yOrigin, long duration){
AnimatedMoveViewJob result = pool.get();
result.mViewPortHandler = viewPortHandler;
result.xValue = xValue;
result.yValue = yValue;
result.mTrans = trans;
result.view = v;
result.xOrigin = xOrigin;
result.yOrigin = yOrigin;
//result.resetAnimator();
result.animator.setDuration(duration);
return result;
}
示例12: getInstance
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public static ZoomJob getInstance(ViewPortHandler viewPortHandler, float scaleX, float scaleY, float xValue, float yValue,
Transformer trans, YAxis.AxisDependency axis, View v) {
ZoomJob result = pool.get();
result.xValue = xValue;
result.yValue = yValue;
result.scaleX = scaleX;
result.scaleY = scaleY;
result.mViewPortHandler = viewPortHandler;
result.mTrans = trans;
result.axisDependency = axis;
result.view = v;
return result;
}
示例13: ZoomJob
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public ZoomJob(ViewPortHandler viewPortHandler, float scaleX, float scaleY, float xValue, float yValue, Transformer trans,
YAxis.AxisDependency axis, View v) {
super(viewPortHandler, xValue, yValue, trans, v);
this.scaleX = scaleX;
this.scaleY = scaleY;
this.axisDependency = axis;
}
示例14: ViewPortJob
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public ViewPortJob(ViewPortHandler viewPortHandler, float xValue, float yValue,
Transformer trans, View v) {
this.mViewPortHandler = viewPortHandler;
this.xValue = xValue;
this.yValue = yValue;
this.mTrans = trans;
this.view = v;
}
示例15: getInstance
import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public static AnimatedZoomJob getInstance(ViewPortHandler viewPortHandler, View v, Transformer trans, YAxis axis, float xAxisRange, float scaleX, float scaleY, float xOrigin, float yOrigin, float zoomCenterX, float zoomCenterY, float zoomOriginX, float zoomOriginY, long duration) {
AnimatedZoomJob result = pool.get();
result.mViewPortHandler = viewPortHandler;
result.xValue = scaleX;
result.yValue = scaleY;
result.mTrans = trans;
result.view = v;
result.xOrigin = xOrigin;
result.yOrigin = yOrigin;
result.resetAnimator();
result.animator.setDuration(duration);
return result;
}