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


Java RadarDataSet.isDrawFilledEnabled方法代码示例

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


在下文中一共展示了RadarDataSet.isDrawFilledEnabled方法的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);
    }
 
开发者ID:xinpengfei520,项目名称:P2P,代码行数:53,代码来源:RadarChartRenderer.java

示例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);
    }
}
 
开发者ID:LINKIWI,项目名称:mobile-manager-for-cloudflare,代码行数:53,代码来源:RadarChart.java

示例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);
    }
}
 
开发者ID:MPieter,项目名称:Notification-Analyser,代码行数:53,代码来源:RadarChart.java


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