本文整理汇总了Java中com.github.mikephil.charting.data.RadarDataSet.getFillAlpha方法的典型用法代码示例。如果您正苦于以下问题:Java RadarDataSet.getFillAlpha方法的具体用法?Java RadarDataSet.getFillAlpha怎么用?Java RadarDataSet.getFillAlpha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.RadarDataSet
的用法示例。
在下文中一共展示了RadarDataSet.getFillAlpha方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawDataSet
import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
protected void drawDataSet(Canvas c, RadarDataSet dataSet) {
float sliceangle = mChart.getSliceAngle();
// calculate the factor that is needed for transforming the value to
// pixels
float factor = mChart.getFactor();
PointF center = mChart.getCenterOffsets();
List<Entry> entries = dataSet.getYVals();
Path surface = new Path();
boolean hasMovedToPoint = false;
for (int j = 0; j < entries.size(); j++) {
mRenderPaint.setColor(dataSet.getColor(j));
Entry e = entries.get(j);
PointF p = Utils.getPosition(center, (e.getVal() - mChart.getYChartMin()) * factor,
sliceangle * j + mChart.getRotationAngle());
if (Float.isNaN(p.x))
continue;
if (!hasMovedToPoint) {
surface.moveTo(p.x, p.y);
hasMovedToPoint = true;
} else
surface.lineTo(p.x, p.y);
}
surface.close();
// draw filled
if (dataSet.isDrawFilledEnabled()) {
mRenderPaint.setStyle(Paint.Style.FILL);
mRenderPaint.setAlpha(dataSet.getFillAlpha());
c.drawPath(surface, mRenderPaint);
mRenderPaint.setAlpha(255);
}
mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
mRenderPaint.setStyle(Paint.Style.STROKE);
// draw the line (only if filled is disabled or alpha is below 255)
if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255)
c.drawPath(surface, mRenderPaint);
}
示例2: drawData
import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
protected void drawData() {
ArrayList<RadarDataSet> dataSets = mData.getDataSets();
float sliceangle = getSliceAngle();
// calculate the factor that is needed for transforming the value to
// pixels
float factor = getFactor();
PointF c = getCenterOffsets();
for (int i = 0; i < mData.getDataSetCount(); i++) {
RadarDataSet dataSet = dataSets.get(i);
ArrayList<Entry> entries = dataSet.getYVals();
Path surface = new Path();
for (int j = 0; j < entries.size(); j++) {
mRenderPaint.setColor(dataSet.getColor(j));
Entry e = entries.get(j);
PointF p = getPosition(c, e.getVal() * factor, sliceangle * j + mRotationAngle);
if (j == 0)
surface.moveTo(p.x, p.y);
else
surface.lineTo(p.x, p.y);
}
surface.close();
// draw filled
if (dataSet.isDrawFilledEnabled()) {
mRenderPaint.setStyle(Paint.Style.FILL);
mRenderPaint.setAlpha(dataSet.getFillAlpha());
mDrawCanvas.drawPath(surface, mRenderPaint);
mRenderPaint.setAlpha(255);
}
mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
mRenderPaint.setStyle(Paint.Style.STROKE);
// draw the line (only if filled is disabled or alpha is below 255)
if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255)
mDrawCanvas.drawPath(surface, mRenderPaint);
}
}
示例3: drawData
import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
protected void drawData() {
ArrayList<RadarDataSet> dataSets = mCurrentData.getDataSets();
float sliceangle = getSliceAngle();
// calculate the factor that is needed for transforming the value to
// pixels
float factor = getFactor();
PointF c = getCenterOffsets();
for (int i = 0; i < mCurrentData.getDataSetCount(); i++) {
RadarDataSet dataSet = dataSets.get(i);
ArrayList<Entry> entries = dataSet.getYVals();
Path surface = new Path();
for (int j = 0; j < entries.size(); j++) {
mRenderPaint.setColor(dataSet.getColor(j));
Entry e = entries.get(j);
PointF p = getPosition(c, e.getVal() * factor, sliceangle * j + mRotationAngle);
if (j == 0)
surface.moveTo(p.x, p.y);
else
surface.lineTo(p.x, p.y);
}
surface.close();
// draw filled
if (dataSet.isDrawFilledEnabled()) {
mRenderPaint.setStyle(Paint.Style.FILL);
mRenderPaint.setAlpha(dataSet.getFillAlpha());
mDrawCanvas.drawPath(surface, mRenderPaint);
mRenderPaint.setAlpha(255);
}
mRenderPaint.setStrokeWidth(dataSet.getLineWidth());
mRenderPaint.setStyle(Paint.Style.STROKE);
// draw the line (only if filled is disabled or alpha is below 255)
if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255)
mDrawCanvas.drawPath(surface, mRenderPaint);
}
}