本文整理匯總了Java中com.github.mikephil.charting.data.Entry.getIcon方法的典型用法代碼示例。如果您正苦於以下問題:Java Entry.getIcon方法的具體用法?Java Entry.getIcon怎麽用?Java Entry.getIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.data.Entry
的用法示例。
在下文中一共展示了Entry.getIcon方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawValues
import com.github.mikephil.charting.data.Entry; //導入方法依賴的package包/類
@Override
public void drawValues(Canvas c) {
// if values are drawn
if (isDrawingValuesAllowed(mChart)) {
List<IScatterDataSet> dataSets = mChart.getScatterData().getDataSets();
for (int i = 0; i < mChart.getScatterData().getDataSetCount(); i++) {
IScatterDataSet dataSet = dataSets.get(i);
if (!shouldDrawValues(dataSet))
continue;
// apply the text-styling defined by the DataSet
applyValueTextStyle(dataSet);
mXBounds.set(mChart, dataSet);
float[] positions = mChart.getTransformer(dataSet.getAxisDependency())
.generateTransformedValuesScatter(dataSet,
mAnimator.getPhaseX(), mAnimator.getPhaseY(), mXBounds.min, mXBounds.max);
float shapeSize = Utils.convertDpToPixel(dataSet.getScatterShapeSize());
MPPointF iconsOffset = MPPointF.getInstance(dataSet.getIconsOffset());
iconsOffset.x = Utils.convertDpToPixel(iconsOffset.x);
iconsOffset.y = Utils.convertDpToPixel(iconsOffset.y);
for (int j = 0; j < positions.length; j += 2) {
if (!mViewPortHandler.isInBoundsRight(positions[j]))
break;
// make sure the lines don't do shitty things outside bounds
if ((!mViewPortHandler.isInBoundsLeft(positions[j])
|| !mViewPortHandler.isInBoundsY(positions[j + 1])))
continue;
Entry entry = dataSet.getEntryForIndex(j / 2 + mXBounds.min);
if (dataSet.isDrawValuesEnabled()) {
drawValue(c,
dataSet.getValueFormatter(),
entry.getY(),
entry,
i,
positions[j],
positions[j + 1] - shapeSize,
dataSet.getValueTextColor(j / 2 + mXBounds.min));
}
if (entry.getIcon() != null && dataSet.isDrawIconsEnabled()) {
Drawable icon = entry.getIcon();
Utils.drawImage(
c,
icon,
(int)(positions[j] + iconsOffset.x),
(int)(positions[j + 1] + iconsOffset.y),
icon.getIntrinsicWidth(),
icon.getIntrinsicHeight());
}
}
MPPointF.recycleInstance(iconsOffset);
}
}
}