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


Java ILineDataSet.getCircleColorCount方法代码示例

本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.ILineDataSet.getCircleColorCount方法的典型用法代码示例。如果您正苦于以下问题:Java ILineDataSet.getCircleColorCount方法的具体用法?Java ILineDataSet.getCircleColorCount怎么用?Java ILineDataSet.getCircleColorCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.mikephil.charting.interfaces.datasets.ILineDataSet的用法示例。


在下文中一共展示了ILineDataSet.getCircleColorCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的package包/类
/**
 * Sets up the cache, returns true if a change of cache was required.
 *
 * @param set
 * @return
 */
protected boolean init(ILineDataSet set) {

    int size = set.getCircleColorCount();
    boolean changeRequired = false;

    if (circleBitmaps == null) {
        circleBitmaps = new Bitmap[size];
        changeRequired = true;
    } else if (circleBitmaps.length != size) {
        circleBitmaps = new Bitmap[size];
        changeRequired = true;
    }

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

示例2: fill

import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; //导入方法依赖的package包/类
/**
 * Fills the cache with bitmaps for the given dataset.
 *
 * @param set
 * @param drawCircleHole
 * @param drawTransparentCircleHole
 */
protected void fill(ILineDataSet set, boolean drawCircleHole, boolean drawTransparentCircleHole) {

    int colorCount = set.getCircleColorCount();
    float circleRadius = set.getCircleRadius();
    float circleHoleRadius = set.getCircleHoleRadius();

    for (int i = 0; i < colorCount; i++) {

        Bitmap.Config conf = Bitmap.Config.ARGB_4444;
        Bitmap circleBitmap = Bitmap.createBitmap((int) (circleRadius * 2.1), (int) (circleRadius * 2.1), conf);

        Canvas canvas = new Canvas(circleBitmap);
        circleBitmaps[i] = circleBitmap;
        mRenderPaint.setColor(set.getCircleColor(i));

        if (drawTransparentCircleHole) {
            // Begin path for circle with hole
            mCirclePathBuffer.reset();

            mCirclePathBuffer.addCircle(
                    circleRadius,
                    circleRadius,
                    circleRadius,
                    Path.Direction.CW);

            // Cut hole in path
            mCirclePathBuffer.addCircle(
                    circleRadius,
                    circleRadius,
                    circleHoleRadius,
                    Path.Direction.CCW);

            // Fill in-between
            canvas.drawPath(mCirclePathBuffer, mRenderPaint);
        } else {

            canvas.drawCircle(
                    circleRadius,
                    circleRadius,
                    circleRadius,
                    mRenderPaint);

            if (drawCircleHole) {
                canvas.drawCircle(
                        circleRadius,
                        circleRadius,
                        circleHoleRadius,
                        mCirclePaintInner);
            }
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:60,代码来源:LineChartRenderer.java


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