Java Code Examples for com.github.mikephil.charting.interfaces.datasets.IDataSet#addEntry()

The following examples show how to use com.github.mikephil.charting.interfaces.datasets.IDataSet#addEntry() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChartData.java    From StockChart-MPAndroidChart with MIT License 6 votes vote down vote up
/**
 * 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;
        }

        calcMinMax(e, set.getAxisDependency());

    } else {
        Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
    }
}
 
Example 2
Source File: ChartData.java    From Ticket-Analysis with MIT License 6 votes vote down vote up
/**
 * 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;

        calcMinMax(e, set.getAxisDependency());

    } else {
        Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
    }
}
 
Example 3
Source File: ChartData.java    From android-kline with Apache License 2.0 6 votes vote down vote up
/**
 * 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;

        calcMinMax(e, set.getAxisDependency());

    } else {
        Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
    }
}
 
Example 4
Source File: ChartData.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
/**
 * 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.");
    }
}
 
Example 5
Source File: ChartData.java    From NetKnight with Apache License 2.0 4 votes vote down vote up
/**
 * 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.");
    }
}