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


Java ILineDataSet.getFillDrawable方法代码示例

本文整理汇总了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());
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:LineChartRenderer.java

示例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());
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:19,代码来源:LineChartRenderer.java

示例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());
        }
    }
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:21,代码来源:LineChartRenderer.java

示例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);

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:47,代码来源:LineChartRenderer.java

示例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());
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:34,代码来源:LineChartRenderer.java

示例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);

}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:48,代码来源:LineChartRenderer.java


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