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


Java IDataSet.getEntryCount方法代码示例

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


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

示例1: drawMarkers

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
 * draws all MarkerViews on the highlighted positions
 */
protected void drawMarkers(Canvas canvas) {

    // if there is no marker view or drawing marker is disabled
    if (mMarker == null || !isDrawMarkersEnabled() || !valuesToHighlight())
        return;

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

        Highlight highlight = mIndicesToHighlight[i];

        IDataSet set = mData.getDataSetByIndex(highlight.getDataSetIndex());

        Entry e = mData.getEntryForHighlight(mIndicesToHighlight[i]);
        int entryIndex = set.getEntryIndex(e);

        // make sure entry not null
        if (e == null || entryIndex > set.getEntryCount() * mAnimator.getPhaseX())
            continue;

        float[] pos = getMarkerPosition(highlight);

        // check bounds
        if (!mViewPortHandler.isInBounds(pos[0], pos[1]))
            continue;

        // callbacks to update the content
        mMarker.refreshContent(e, highlight);

        // draw the marker
        mMarker.draw(canvas, pos[0], pos[1]);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:36,代码来源:Chart.java

示例2: drawMarkers

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
 * draws all MarkerViews on the highlighted positions
 */
protected void drawMarkers(Canvas canvas) {

    // if there is no marker view or drawing marker is disabled
    if (mMarkerView == null || !mDrawMarkerViews || !valuesToHighlight())
        return;

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

        Highlight highlight = mIndicesToHighlight[i];

        IDataSet set = mData.getDataSetByIndex(highlight.getDataSetIndex());

        Entry e = mData.getEntryForHighlight(mIndicesToHighlight[i]);
        int entryIndex = set.getEntryIndex(e);

        // make sure entry not null
        if (e == null || entryIndex > set.getEntryCount() * mAnimator.getPhaseX())
            continue;

        float[] pos = getMarkerPosition(highlight);

        // check bounds
        if (!mViewPortHandler.isInBounds(pos[0], pos[1]))
            continue;

        // callbacks to update the content
        mMarkerView.refreshContent(e, highlight);

        mMarkerView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
                MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
        mMarkerView.layout(0, 0, mMarkerView.getMeasuredWidth(),
                mMarkerView.getMeasuredHeight());

        if (pos[1] - mMarkerView.getHeight() <= 0) {
            float y = mMarkerView.getHeight() - pos[1];
            mMarkerView.draw(canvas, pos[0], pos[1] + y);
        } else {
            mMarkerView.draw(canvas, pos[0], pos[1]);
        }
    }
}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:45,代码来源:Chart.java


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