Java Code Examples for com.github.mikephil.charting.data.LineData#getYMin()

The following examples show how to use com.github.mikephil.charting.data.LineData#getYMin() . 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: DefaultFillFormatter.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {

    float fillMin = 0f;
    float chartMaxY = dataProvider.getYChartMax();
    float chartMinY = dataProvider.getYChartMin();

    LineData data = dataProvider.getLineData();

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        float max, min;

        if (data.getYMax() > 0) {
            max = 0f;
        } else {
            max = chartMaxY;
        }
        if (data.getYMin() < 0) {
            min = 0f;
        } else {
            min = chartMinY;
        }

        fillMin = dataSet.getYMin() >= 0 ? min : max;
    }

    return fillMin;
}
 
Example 2
Source File: DefaultFillFormatter.java    From Ticket-Analysis with MIT License 5 votes vote down vote up
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {

    float fillMin = 0f;
    float chartMaxY = dataProvider.getYChartMax();
    float chartMinY = dataProvider.getYChartMin();

    LineData data = dataProvider.getLineData();

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        float max, min;

        if (data.getYMax() > 0)
            max = 0f;
        else
            max = chartMaxY;
        if (data.getYMin() < 0)
            min = 0f;
        else
            min = chartMinY;

        fillMin = dataSet.getYMin() >= 0 ? min : max;
    }

    return fillMin;
}
 
Example 3
Source File: DefaultFillFormatter.java    From android-kline with Apache License 2.0 5 votes vote down vote up
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {

    float fillMin = 0f;
    float chartMaxY = dataProvider.getYChartMax();
    float chartMinY = dataProvider.getYChartMin();

    LineData data = dataProvider.getLineData();

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        float max, min;

        if (data.getYMax() > 0)
            max = 0f;
        else
            max = chartMaxY;
        if (data.getYMin() < 0)
            min = 0f;
        else
            min = chartMinY;

        fillMin = dataSet.getYMin() >= 0 ? min : max;
    }

    return fillMin;
}
 
Example 4
Source File: DefaultFillFormatter.java    From iMoney with Apache License 2.0 5 votes vote down vote up
@Override
public float getFillLinePosition(LineDataSet dataSet, LineDataProvider dataProvider) {

    float fillMin = 0f;
    float chartMaxY = dataProvider.getYChartMax();
    float chartMinY = dataProvider.getYChartMin();

    LineData data = dataProvider.getLineData();

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        if (!dataProvider.getAxis(dataSet.getAxisDependency()).isStartAtZeroEnabled()) {

            float max, min;

            if (data.getYMax() > 0)
                max = 0f;
            else
                max = chartMaxY;
            if (data.getYMin() < 0)
                min = 0f;
            else
                min = chartMinY;

            fillMin = dataSet.getYMin() >= 0 ? min : max;
        } else {
            fillMin = 0f;
        }
    }

    return fillMin;
}
 
Example 5
Source File: DefaultFillFormatter.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {

    float fillMin = 0f;
    float chartMaxY = dataProvider.getYChartMax();
    float chartMinY = dataProvider.getYChartMin();

    LineData data = dataProvider.getLineData();

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        float max, min;

        if (data.getYMax() > 0)
            max = 0f;
        else
            max = chartMaxY;
        if (data.getYMin() < 0)
            min = 0f;
        else
            min = chartMinY;

        fillMin = dataSet.getYMin() >= 0 ? min : max;
    }

    return fillMin;
}
 
Example 6
Source File: DefaultFillFormatter.java    From NetKnight with Apache License 2.0 5 votes vote down vote up
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {

    float fillMin = 0f;
    float chartMaxY = dataProvider.getYChartMax();
    float chartMinY = dataProvider.getYChartMin();

    LineData data = dataProvider.getLineData();

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        float max, min;

        if (data.getYMax() > 0)
            max = 0f;
        else
            max = chartMaxY;
        if (data.getYMin() < 0)
            min = 0f;
        else
            min = chartMinY;

        fillMin = dataSet.getYMin() >= 0 ? min : max;
    }

    return fillMin;
}
 
Example 7
Source File: LineChart.java    From Notification-Analyser with MIT License 5 votes vote down vote up
@Override
public float getFillLinePosition(LineDataSet dataSet, LineData data,
        float chartMaxY, float chartMinY) {

    float fillMin = 0f;

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        if (!mStartAtZero) {

            float max, min;

            if (data.getYMax() > 0)
                max = 0f;
            else
                max = chartMaxY;
            if (data.getYMin() < 0)
                min = 0f;
            else
                min = chartMinY;

            fillMin = dataSet.getYMin() >= 0 ? min : max;
        } else {
            fillMin = 0f;
        }

    }

    return fillMin;
}