• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Transformer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.mikephil.charting.utils.Transformer的典型用法代码示例。如果您正苦于以下问题:Java Transformer类的具体用法?Java Transformer怎么用?Java Transformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Transformer类属于com.github.mikephil.charting.utils包,在下文中一共展示了Transformer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:LineChartRenderer.java


示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:AxisRenderer.java


示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:YAxisRenderer.java


示例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());
    }
}
 
开发者ID:muyoumumumu,项目名称:QuShuChe,代码行数:19,代码来源:LineChartRenderer.java


示例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());
        }
    }
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:21,代码来源:LineChartRenderer.java


示例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));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:31,代码来源:BarLineChartBase.java


示例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);

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:47,代码来源:LineChartRenderer.java


示例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());
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:BarChartRenderer.java


示例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));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:XAxisRenderer.java


示例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());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:HorizontalBarChartRenderer.java


示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:AnimatedMoveViewJob.java


示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:ZoomJob.java


示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ZoomJob.java


示例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;

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:ViewPortJob.java


示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:AnimatedZoomJob.java


示例16: AnimatedZoomJob

import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
@SuppressLint("NewApi")
public AnimatedZoomJob(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) {
    super(viewPortHandler, scaleX, scaleY, trans, v, xOrigin, yOrigin, duration);

    this.zoomCenterX = zoomCenterX;
    this.zoomCenterY = zoomCenterY;
    this.zoomOriginX = zoomOriginX;
    this.zoomOriginY = zoomOriginY;
    this.animator.addListener(this);
    this.yAxis = axis;
    this.xAxisRange = xAxisRange;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:AnimatedZoomJob.java


示例17: AnimatedViewPortJob

import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public AnimatedViewPortJob(ViewPortHandler viewPortHandler, float xValue, float yValue, Transformer trans, View v, float xOrigin, float yOrigin, long duration) {
    super(viewPortHandler, xValue, yValue, trans, v);
    this.xOrigin = xOrigin;
    this.yOrigin = yOrigin;
    animator = ObjectAnimator.ofFloat(this, "phase", 0f, 1f);
    animator.setDuration(duration);
    animator.addUpdateListener(this);
    animator.addListener(this);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:AnimatedViewPortJob.java


示例18: getInstance

import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
public static MoveViewJob getInstance(ViewPortHandler viewPortHandler, float xValue, float yValue, Transformer trans, View v){
    MoveViewJob result = pool.get();
    result.mViewPortHandler = viewPortHandler;
    result.xValue = xValue;
    result.yValue = yValue;
    result.mTrans = trans;
    result.view = v;
    return result;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:MoveViewJob.java


示例19: 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);

    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));
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:33,代码来源:BarLineChartBase.java


示例20: drawCubicFill

import com.github.mikephil.charting.utils.Transformer; //导入依赖的package包/类
protected void drawCubicFill(Canvas c, ILineDataSet dataSet, Path spline, Transformer trans,
                             int from, int to) {

    if (to - from <= 1)
        return;

    float fillMin = dataSet.getFillFormatter()
            .getFillLinePosition(dataSet, mChart);
    
    // Take the from/to xIndex from the entries themselves,
    // so missing entries won't screw up the filling.
    // What we need to draw is line from points of the xIndexes - not arbitrary entry indexes!

    final Entry toEntry = dataSet.getEntryForIndex(to - 1);
    final Entry fromEntry = dataSet.getEntryForIndex(from);
    final float xTo = toEntry == null ? 0 : toEntry.getXIndex();
    final float xFrom = fromEntry == null ? 0 : fromEntry.getXIndex();

    spline.lineTo(xTo, fillMin);
    spline.lineTo(xFrom, 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());
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:34,代码来源:LineChartRenderer.java



注:本文中的com.github.mikephil.charting.utils.Transformer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HasKeyDownHandlers类代码示例发布时间:2022-05-22
下一篇:
Java TemporarySocketDirectory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap