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


Java RadarDataSet.getEntryForXIndex方法代码示例

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


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

示例1: drawHighlights

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

    // if there are values to highlight and highlighnting is enabled, do it
    if (mHighlightEnabled && valuesToHighlight()) {

        float sliceangle = getSliceAngle();
        float factor = getFactor();

        PointF c = getCenterOffsets();

        for (int i = 0; i < mIndicesToHightlight.length; i++) {

            RadarDataSet set = mData
                    .getDataSetByIndex(mIndicesToHightlight[i]
                            .getDataSetIndex());

            if (set == null)
                continue;

            mHighlightPaint.setColor(set.getHighLightColor());

            // get the index to highlight
            int xIndex = mIndicesToHightlight[i].getXIndex();

            Entry e = set.getEntryForXIndex(xIndex);
            int j = set.getEntryPosition(e);
            float y = e.getVal();

            PointF p = getPosition(c, y * factor, sliceangle * j + mRotationAngle);

            float[] pts = new float[] {
                    p.x, 0, p.x, getHeight(), 0, p.y, getWidth(), p.y
            };

            mDrawCanvas.drawLines(pts, mHighlightPaint);
        }
    }
}
 
开发者ID:LINKIWI,项目名称:mobile-manager-for-cloudflare,代码行数:40,代码来源:RadarChart.java

示例2: drawHighlights

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

    // if there are values to highlight and highlighnting is enabled, do it
    if (mHighlightEnabled && valuesToHighlight()) {

        float sliceangle = getSliceAngle();
        float factor = getFactor();

        PointF c = getCenterOffsets();

        for (int i = 0; i < mIndicesToHightlight.length; i++) {

            RadarDataSet set = mCurrentData
                    .getDataSetByIndex(mIndicesToHightlight[i]
                            .getDataSetIndex());

            if (set == null)
                continue;

            mHighlightPaint.setColor(set.getHighLightColor());

            // get the index to highlight
            int xIndex = mIndicesToHightlight[i].getXIndex();

            Entry e = set.getEntryForXIndex(xIndex);
            int j = set.getEntryPosition(e);
            float y = e.getVal();

            PointF p = getPosition(c, y * factor, sliceangle * j + mRotationAngle);

            float[] pts = new float[] {
                    p.x, 0, p.x, getHeight(), 0, p.y, getWidth(), p.y
            };

            mDrawCanvas.drawLines(pts, mHighlightPaint);
        }
    }
}
 
开发者ID:MPieter,项目名称:Notification-Analyser,代码行数:40,代码来源:RadarChart.java

示例3: drawHighlighted

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

    float sliceangle = mChart.getSliceAngle();
    float factor = mChart.getFactor();

    PointF center = mChart.getCenterOffsets();

    for (int i = 0; i < indices.length; i++) {

        RadarDataSet set = mChart.getData()
                .getDataSetByIndex(indices[i]
                        .getDataSetIndex());

        if (set == null || !set.isHighlightEnabled())
            continue;

        // get the index to highlight
        int xIndex = indices[i].getXIndex();

        Entry e = set.getEntryForXIndex(xIndex);
        if (e == null || e.getXIndex() != xIndex)
            continue;

        int j = set.getEntryPosition(e);
        float y = (e.getVal() - mChart.getYChartMin());

        if (Float.isNaN(y))
            continue;

        PointF p = Utils.getPosition(center, y * factor,
                sliceangle * j + mChart.getRotationAngle());

        float[] pts = new float[]{
                p.x, p.y
        };

        // draw the lines
        drawHighlightLines(c, pts, set);
    }
}
 
开发者ID:xinpengfei520,项目名称:P2P,代码行数:42,代码来源:RadarChartRenderer.java


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