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


Java IDataSet.getAxisDependency方法代码示例

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


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

示例1: addEntry

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
 * Adds an Entry to the DataSet at the specified index.
 * Entries are added to the end of the list.
 *
 * @param e
 * @param dataSetIndex
 */
public void addEntry(Entry e, int dataSetIndex) {

    if (mDataSets.size() > dataSetIndex && dataSetIndex >= 0) {

        IDataSet set = mDataSets.get(dataSetIndex);
        // add the entry to the dataset
        if (!set.addEntry(e))
            return;

        float val = e.getVal();

        if (mYValCount == 0) {
            mYMin = val;
            mYMax = val;

            if (set.getAxisDependency() == AxisDependency.LEFT) {

                mLeftAxisMax = e.getVal();
                mLeftAxisMin = e.getVal();
            } else {
                mRightAxisMax = e.getVal();
                mRightAxisMin = e.getVal();
            }
        } else {

            if (mYMax < val)
                mYMax = val;
            if (mYMin > val)
                mYMin = val;

            if (set.getAxisDependency() == AxisDependency.LEFT) {

                if (mLeftAxisMax < e.getVal())
                    mLeftAxisMax = e.getVal();
                if (mLeftAxisMin > e.getVal())
                    mLeftAxisMin = e.getVal();
            } else {
                if (mRightAxisMax < e.getVal())
                    mRightAxisMax = e.getVal();
                if (mRightAxisMin > e.getVal())
                    mRightAxisMin = e.getVal();
            }
        }

        mYValCount += 1;

        handleEmptyAxis(getFirstLeft(), getFirstRight());

    } else {
        Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:60,代码来源:ChartData.java

示例2: addEntry

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
 * Adds an Entry to the DataSet at the specified index.
 * Entries are added to the end of the list.
 *
 * @param e
 * @param dataSetIndex
 */
public void addEntry(Entry e, int dataSetIndex) {

    if (mDataSets.size() > dataSetIndex && dataSetIndex >= 0) {

        IDataSet set = mDataSets.get(dataSetIndex);
        // add the entry to the dataset
        if (!set.addEntry(e))
            return;

        float val = e.getVal();

        if (mYValCount == 0) {
            mYMin = val;
            mYMax = val;

            if (set.getAxisDependency() == YAxis.AxisDependency.LEFT) {

                mLeftAxisMax = e.getVal();
                mLeftAxisMin = e.getVal();
            } else {
                mRightAxisMax = e.getVal();
                mRightAxisMin = e.getVal();
            }
        } else {

            if (mYMax < val)
                mYMax = val;
            if (mYMin > val)
                mYMin = val;

            if (set.getAxisDependency() == YAxis.AxisDependency.LEFT) {

                if (mLeftAxisMax < e.getVal())
                    mLeftAxisMax = e.getVal();
                if (mLeftAxisMin > e.getVal())
                    mLeftAxisMin = e.getVal();
            } else {
                if (mRightAxisMax < e.getVal())
                    mRightAxisMax = e.getVal();
                if (mRightAxisMin > e.getVal())
                    mRightAxisMin = e.getVal();
            }
        }

        mYValCount += 1;

        handleEmptyAxis(getFirstLeft(), getFirstRight());

    } else {
        Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
    }
}
 
开发者ID:muyoumumumu,项目名称:QuShuChe,代码行数:60,代码来源:ChartData.java

示例3: buildHighlight

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
 * Returns the Highlight object corresponding to the selected xValue and dataSetIndex.
 *
 * @param set
 * @param dataSetIndex
 * @param xVal
 * @param rounding
 * @return
 */
protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, DataSet.Rounding rounding) {

    final Entry e = set.getEntryForXPos(xVal, rounding);

    if (e == null)
        return null;

    MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getX(), e.getY());

    return new Highlight(e.getX(), e.getY(), (float) pixels.x, (float) pixels.y, dataSetIndex, set.getAxisDependency());
}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:21,代码来源:ChartHighlighter.java

示例4: buildHighlight

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
protected Highlight buildHighlight(IDataSet set, int dataSetIndex, float xVal, DataSet.Rounding rounding) {

	final Entry e = set.getEntryForXPos(xVal, rounding);

	MPPointD pixels = mChart.getTransformer(set.getAxisDependency()).getPixelsForValues(e.getY(), e.getX());

	return new Highlight(e.getX(), e.getY(), (float) pixels.x, (float) pixels.y, dataSetIndex, set.getAxisDependency());
}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:10,代码来源:HorizontalBarHighlighter.java


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