Java Code Examples for com.github.mikephil.charting.data.LineData#getYMax()
The following examples show how to use
com.github.mikephil.charting.data.LineData#getYMax() .
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 |
@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 |
@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 |
@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 |
@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 |
@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 |
@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: LineChartCard.java From ResearchStack with Apache License 2.0 | 5 votes |
public void setData(LineData data, int viewportStart, int viewPortEnd) { float maxOffset = data.getYMax() + (data.getYMax() * .05f); chart.setData(data); chart.getAxisLeft().setAxisMaxValue(maxOffset); chart.getAxisRight().setAxisMaxValue(maxOffset); if (viewportStart != viewPortEnd) { chart.setVisibleXRange(viewportStart, viewPortEnd); } chart.notifyDataSetChanged(); chart.invalidate(); }
Example 8
Source File: LineChart.java From Notification-Analyser with MIT License | 5 votes |
@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; }