本文整理汇总了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);
}
}
示例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());
}
}
示例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);
}
示例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);
}
示例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());
}
}
示例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);
}
}
示例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);
}
}