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


Java RadarDataSet.getYVals方法代码示例

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


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

示例1: drawValues

import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
protected void drawValues() {

    // if values are drawn
    if (mDrawYValues) {

        float sliceangle = getSliceAngle();

        // calculate the factor that is needed for transforming the value to
        // pixels
        float factor = getFactor();

        PointF c = getCenterOffsets();

        float yoffset = Utils.convertDpToPixel(5f);

        for (int i = 0; i < mData.getDataSetCount(); i++) {

            RadarDataSet dataSet = mData.getDataSetByIndex(i);
            ArrayList<Entry> entries = dataSet.getYVals();

            for (int j = 0; j < entries.size(); j++) {

                Entry e = entries.get(j);

                PointF p = getPosition(c, e.getVal() * factor, sliceangle * j + mRotationAngle);

                if (mDrawUnitInChart)
                    mDrawCanvas.drawText(mValueFormatter.getFormattedValue(e.getVal()) + mUnit,
                            p.x, p.y - yoffset, mValuePaint);
                else
                    mDrawCanvas.drawText(mValueFormatter.getFormattedValue(e.getVal()),
                            p.x, p.y - yoffset, mValuePaint);
            }
        }
    }
}
 
开发者ID:LINKIWI,项目名称:mobile-manager-for-cloudflare,代码行数:38,代码来源:RadarChart.java

示例2: drawValues

import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
protected void drawValues() {

    // if values are drawn
    if (mDrawYValues) {

        float sliceangle = getSliceAngle();

        // calculate the factor that is needed for transforming the value to
        // pixels
        float factor = getFactor();

        PointF c = getCenterOffsets();

        float yoffset = Utils.convertDpToPixel(5f);

        for (int i = 0; i < mCurrentData.getDataSetCount(); i++) {

            RadarDataSet dataSet = mCurrentData.getDataSetByIndex(i);
            ArrayList<Entry> entries = dataSet.getYVals();

            for (int j = 0; j < entries.size(); j++) {

                Entry e = entries.get(j);

                PointF p = getPosition(c, e.getVal() * factor, sliceangle * j + mRotationAngle);

                if (mDrawUnitInChart)
                    mDrawCanvas.drawText(mValueFormatter.getFormattedValue(e.getVal()) + mUnit,
                            p.x, p.y - yoffset, mValuePaint);
                else
                    mDrawCanvas.drawText(mValueFormatter.getFormattedValue(e.getVal()),
                            p.x, p.y - yoffset, mValuePaint);
            }
        }
    }
}
 
开发者ID:MPieter,项目名称:Notification-Analyser,代码行数:38,代码来源:RadarChart.java

示例3: 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

示例4: 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

示例5: 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

示例6: drawValues

import com.github.mikephil.charting.data.RadarDataSet; //导入方法依赖的package包/类
@Override
public void drawValues(Canvas c) {

    float sliceangle = mChart.getSliceAngle();

    // calculate the factor that is needed for transforming the value to
    // pixels
    float factor = mChart.getFactor();

    PointF center = mChart.getCenterOffsets();

    float yoffset = Utils.convertDpToPixel(5f);

    for (int i = 0; i < mChart.getData().getDataSetCount(); i++) {

        RadarDataSet dataSet = mChart.getData().getDataSetByIndex(i);

        if (!dataSet.isDrawValuesEnabled() || dataSet.getEntryCount() == 0)
            continue;

        // apply the text-styling defined by the DataSet
        applyValueTextStyle(dataSet);

        List<Entry> entries = dataSet.getYVals();

        for (int j = 0; j < entries.size(); j++) {

            Entry entry = entries.get(j);

            PointF p = Utils.getPosition(center, (entry.getVal() - mChart.getYChartMin()) * factor,
                    sliceangle * j + mChart.getRotationAngle());

            drawValue(c, dataSet.getValueFormatter(), entry.getVal(), entry, i, p.x, p.y - yoffset);
        }
    }
}
 
开发者ID:xinpengfei520,项目名称:P2P,代码行数:37,代码来源:RadarChartRenderer.java


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