当前位置: 首页>>代码示例>>Java>>正文


Java LimitLine.getLimit方法代码示例

本文整理汇总了Java中com.github.mikephil.charting.components.LimitLine.getLimit方法的典型用法代码示例。如果您正苦于以下问题:Java LimitLine.getLimit方法的具体用法?Java LimitLine.getLimit怎么用?Java LimitLine.getLimit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.mikephil.charting.components.LimitLine的用法示例。


在下文中一共展示了LimitLine.getLimit方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderLimitLines

import com.github.mikephil.charting.components.LimitLine; //导入方法依赖的package包/类
/**
 * Draws the LimitLines associated with this axis to the screen.
 *
 * @param c
 */
@Override
public void renderLimitLines(Canvas c) {

    List<LimitLine> limitLines = mXAxis.getLimitLines();

    if (limitLines == null || limitLines.size() <= 0)
        return;

    float[] position = mRenderLimitLinesBuffer;
    position[0] = 0;
    position[1] = 0;

    for (int i = 0; i < limitLines.size(); i++) {

        LimitLine l = limitLines.get(i);

        if (!l.isEnabled())
            continue;

        int clipRestoreCount = c.save();
        mLimitLineClippingRect.set(mViewPortHandler.getContentRect());
        mLimitLineClippingRect.inset(-l.getLineWidth(), 0.f);
        c.clipRect(mLimitLineClippingRect);

        position[0] = l.getLimit();
        position[1] = 0.f;

        mTrans.pointValuesToPixel(position);

        renderLimitLineLine(c, l, position);
        renderLimitLineLabel(c, l, position, 2.f + l.getYOffset());

        c.restoreToCount(clipRestoreCount);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:41,代码来源:XAxisRenderer.java

示例2: renderLimitLines

import com.github.mikephil.charting.components.LimitLine; //导入方法依赖的package包/类
/**
 * Draws the LimitLines associated with this axis to the screen.
 *
 * @param c
 */
@Override
public void renderLimitLines(Canvas c) {

    List<LimitLine> limitLines = mXAxis.getLimitLines();

    if (limitLines == null || limitLines.size() <= 0)
        return;

    float[] position = mRenderLimitLinesBuffer;
    position[0] = 0;
    position[1] = 0;

    for (int i = 0; i < limitLines.size(); i++) {

        LimitLine l = limitLines.get(i);

        if (!l.isEnabled())
            continue;

        position[0] = l.getLimit();
        position[1] = 0.f;

        mTrans.pointValuesToPixel(position);

        renderLimitLineLine(c, l, position);
        renderLimitLineLabel(c, l, position, 2.f + l.getYOffset());
    }
}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:34,代码来源:XAxisRenderer.java

示例3: renderLimitLines

import com.github.mikephil.charting.components.LimitLine; //导入方法依赖的package包/类
@Override
public void renderLimitLines(Canvas c) {

    List<LimitLine> limitLines = mYAxis.getLimitLines();

    if (limitLines == null)
        return;

    float sliceangle = mChart.getSliceAngle();

    // calculate the factor that is needed for transforming the value to
    // pixels
    float factor = mChart.getFactor();

    MPPointF center = mChart.getCenterOffsets();
    MPPointF pOut = MPPointF.getInstance(0,0);
    for (int i = 0; i < limitLines.size(); i++) {

        LimitLine l = limitLines.get(i);

        if (!l.isEnabled())
            continue;

        mLimitLinePaint.setColor(l.getLineColor());
        mLimitLinePaint.setPathEffect(l.getDashPathEffect());
        mLimitLinePaint.setStrokeWidth(l.getLineWidth());

        float r = (l.getLimit() - mChart.getYChartMin()) * factor;

        Path limitPath = mRenderLimitLinesPathBuffer;
        limitPath.reset();


        for (int j = 0; j < mChart.getData().getMaxEntryCountSet().getEntryCount(); j++) {

            Utils.getPosition(center, r, sliceangle * j + mChart.getRotationAngle(), pOut);

            if (j == 0)
                limitPath.moveTo(pOut.x, pOut.y);
            else
                limitPath.lineTo(pOut.x, pOut.y);
        }
        limitPath.close();

        c.drawPath(limitPath, mLimitLinePaint);
    }
    MPPointF.recycleInstance(center);
    MPPointF.recycleInstance(pOut);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:50,代码来源:YAxisRendererRadarChart.java

示例4: renderLimitLines

import com.github.mikephil.charting.components.LimitLine; //导入方法依赖的package包/类
@Override
public void renderLimitLines(Canvas c) {

    List<LimitLine> limitLines = mYAxis.getLimitLines();

    if (limitLines == null || limitLines.size() <= 0)
        return;

    float[] pts = mRenderLimitLinesBuffer;
    pts[0] = 0;
    pts[1] = 0;
    float upperLimit = Float.NaN;

    for (int i = 0; i < limitLines.size(); i++) {

        LimitLine l = limitLines.get(i);

        if (!l.isEnabled())
            continue;

        int clipRestoreCount = c.save();
        mLimitLineClippingRect.set(mViewPortHandler.getContentRect());
        c.clipRect(mLimitLineClippingRect);

        mLimitLinePaint.setStyle(Paint.Style.FILL);
        mLimitLinePaint.setColor(l.getLineColor());

        pts[1] = l.getLimit();

        mTrans.pointValuesToPixel(pts);

        if (Float.isNaN(upperLimit)) {
            upperLimit = pts[1];
        } else {
            float lowerLimit = pts[1];
            if (upperLimit < lowerLimit) {
                lowerLimit = upperLimit;
                upperLimit = pts[1];
            }
            c.drawRect(mViewPortHandler.contentLeft(), lowerLimit, mViewPortHandler.contentRight(), upperLimit, mLimitLinePaint);
            upperLimit = Float.NaN;
        }

        c.restoreToCount(clipRestoreCount);
    }

    super.renderLimitLines(c);
}
 
开发者ID:DorianScholz,项目名称:OpenLibre,代码行数:49,代码来源:LimitAreaYAxisRenderer.java

示例5: renderLimitLines

import com.github.mikephil.charting.components.LimitLine; //导入方法依赖的package包/类
/**
 * Draws the LimitLines associated with this axis to the screen.
 *
 * @param c
 */
@Override
public void renderLimitLines(Canvas c) {

	List<LimitLine> limitLines = mXAxis.getLimitLines();

	if (limitLines == null || limitLines.size() <= 0)
		return;

       float[] position = new float[2];

	for (int i = 0; i < limitLines.size(); i++) {

		LimitLine l = limitLines.get(i);

           if(!l.isEnabled())
               continue;

           position[0] = l.getLimit();
           position[1] = 0.f;

           mTrans.pointValuesToPixel(position);

           renderLimitLineLine(c, l, position);
           renderLimitLineLabel(c, l, position, 2.f + l.getYOffset());
	}
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:32,代码来源:XAxisRenderer.java

示例6: renderLimitLines

import com.github.mikephil.charting.components.LimitLine; //导入方法依赖的package包/类
@Override
public void renderLimitLines(Canvas c) {

    List<LimitLine> limitLines = mYAxis.getLimitLines();

    if (limitLines == null)
        return;

    float sliceangle = mChart.getSliceAngle();

    // calculate the factor that is needed for transforming the value to
    // pixels
    float factor = mChart.getFactor();

    PointF center = mChart.getCenterOffsets();

    for (int i = 0; i < limitLines.size(); i++) {

        LimitLine l = limitLines.get(i);

        if (!l.isEnabled())
            continue;

        mLimitLinePaint.setColor(l.getLineColor());
        mLimitLinePaint.setPathEffect(l.getDashPathEffect());
        mLimitLinePaint.setStrokeWidth(l.getLineWidth());

        float r = (l.getLimit() - mChart.getYChartMin()) * factor;

        Path limitPath = new Path();

        for (int j = 0; j < mChart.getData().getXValCount(); j++) {

            PointF p = Utils.getPosition(center, r, sliceangle * j + mChart.getRotationAngle());

            if (j == 0)
                limitPath.moveTo(p.x, p.y);
            else
                limitPath.lineTo(p.x, p.y);
        }

        limitPath.close();

        c.drawPath(limitPath, mLimitLinePaint);
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:47,代码来源:YAxisRendererRadarChart.java

示例7: renderLimitLines

import com.github.mikephil.charting.components.LimitLine; //导入方法依赖的package包/类
@Override
public void renderLimitLines(Canvas c) {

	List<LimitLine> limitLines = mYAxis.getLimitLines();

	if (limitLines == null)
		return;

	float sliceangle = mChart.getSliceAngle();

	// calculate the factor that is needed for transforming the value to
	// pixels
	float factor = mChart.getFactor();

	PointF center = mChart.getCenterOffsets();

	for (int i = 0; i < limitLines.size(); i++) {

		LimitLine l = limitLines.get(i);

		mLimitLinePaint.setColor(l.getLineColor());
		mLimitLinePaint.setPathEffect(l.getDashPathEffect());
		mLimitLinePaint.setStrokeWidth(l.getLineWidth());

		float r = (l.getLimit() - mChart.getYChartMin()) * factor;

		Path limitPath = new Path();

		for (int j = 0; j < mChart.getData().getXValCount(); j++) {

			PointF p = Utils.getPosition(center, r, sliceangle * j + mChart.getRotationAngle());

			if (j == 0)
				limitPath.moveTo(p.x, p.y);
			else
				limitPath.lineTo(p.x, p.y);
		}

		limitPath.close();

		c.drawPath(limitPath, mLimitLinePaint);
	}
}
 
开发者ID:xinpengfei520,项目名称:P2P,代码行数:44,代码来源:YAxisRendererRadarChart.java


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