本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.ILineDataSet.getFillDrawable方法的典型用法代码示例。如果您正苦于以下问题:Java ILineDataSet.getFillDrawable方法的具体用法?Java ILineDataSet.getFillDrawable怎么用?Java ILineDataSet.getFillDrawable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.interfaces.datasets.ILineDataSet
的用法示例。
在下文中一共展示了ILineDataSet.getFillDrawable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawCubicFill
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的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());
}
}
示例2: drawLinearFill
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的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());
}
}
示例3: drawCubicFill
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的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());
}
}
示例4: drawLinearFill
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的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);
}
示例5: drawCubicFill
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的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());
}
}
示例6: drawLinearFill
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的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);
}