/** * Returns the first DataSet from the datasets-array that has it's dependency on the right axis. * Returns null if no DataSet with right dependency could be found. * * @return */ public T getFirstRight(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.RIGHT) return dataSet; } return null; }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the left axis. * Returns null if no DataSet with left dependency could be found. * * @return */ protected T getFirstLeft(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.LEFT) return dataSet; } return null; }
/** * 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."); } }
/** * Returns true if the current touch situation should be interpreted as inverted, false if not. * * @return */ private boolean inverted() { return (mClosestDataSetToTouch == null && mChart.isAnyAxisInverted()) || (mClosestDataSetToTouch != null && mChart.isInverted(mClosestDataSetToTouch.getAxisDependency())); }
@Override protected List<Highlight> buildHighlights(IDataSet set, int dataSetIndex, float xVal, DataSet.Rounding rounding) { ArrayList<Highlight> highlights = new ArrayList<>(); //noinspection unchecked List<Entry> entries = set.getEntriesForXValue(xVal); if (entries.size() == 0) { // Try to find closest x-value and take all entries for that x-value final Entry closest = set.getEntryForXValue(xVal, Float.NaN, rounding); if (closest != null) { //noinspection unchecked entries = set.getEntriesForXValue(closest.getX()); } } if (entries.size() == 0) return highlights; for (Entry e : entries) { MPPointD pixels = mChart.getTransformer( set.getAxisDependency()).getPixelForValues(e.getY(), e.getX()); highlights.add(new Highlight( e.getX(), e.getY(), (float) pixels.x, (float) pixels.y, dataSetIndex, set.getAxisDependency())); } return highlights; }
set.getAxisDependency()).getPixelForValues(e.getX(), e.getY()); dataSetIndex, set.getAxisDependency()));
if (dataSet.getAxisDependency() == AxisDependency.LEFT) { if (dataSet.getYMin() < mLeftAxisMin) mLeftAxisMin = dataSet.getYMin(); if (dataSet.getAxisDependency() == AxisDependency.RIGHT) { if (dataSet.getYMin() < mRightAxisMin) mRightAxisMin = dataSet.getYMin();
sliceangle * index * phaseX + mChart.getRotationAngle(), pOut); mHighlightBuffer.add(new Highlight(index, entry.getY(), pOut.x, pOut.y, i, dataSet.getAxisDependency()));
/** * Adjusts the minimum and maximum values based on the given DataSet. * * @param d */ protected void calcMinMax(T d) { if (mYMax < d.getYMax()) mYMax = d.getYMax(); if (mYMin > d.getYMin()) mYMin = d.getYMin(); if (mXMax < d.getXMax()) mXMax = d.getXMax(); if (mXMin > d.getXMin()) mXMin = d.getXMin(); if (d.getAxisDependency() == AxisDependency.LEFT) { if (mLeftAxisMax < d.getYMax()) mLeftAxisMax = d.getYMax(); if (mLeftAxisMin > d.getYMin()) mLeftAxisMin = d.getYMin(); } else { if (mRightAxisMax < d.getYMax()) mRightAxisMax = d.getYMax(); if (mRightAxisMin > d.getYMin()) mRightAxisMin = d.getYMin(); } }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the left axis. * Returns null if no DataSet with left dependency could be found. * * @return */ protected T getFirstLeft(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.LEFT) return dataSet; } return null; }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the right axis. * Returns null if no DataSet with right dependency could be found. * * @return */ public T getFirstRight(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.RIGHT) return dataSet; } return null; }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the right axis. * Returns null if no DataSet with right dependency could be found. * * @return */ public T getFirstRight(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.RIGHT) return dataSet; } return null; }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the left axis. * Returns null if no DataSet with left dependency could be found. * * @return */ protected T getFirstLeft(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.LEFT) { return dataSet; } } return null; }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the right axis. * Returns null if no DataSet with right dependency could be found. * * @return */ public T getFirstRight(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.RIGHT) { return dataSet; } } return null; }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the left axis. * Returns null if no DataSet with left dependency could be found. * * @return */ protected T getFirstLeft(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.LEFT) return dataSet; } return null; }
/** * Returns the first DataSet from the datasets-array that has it's dependency on the right axis. * Returns null if no DataSet with right dependency could be found. * * @return */ public T getFirstRight(List<T> sets) { for (T dataSet : sets) { if (dataSet.getAxisDependency() == AxisDependency.RIGHT) return dataSet; } return null; }
/** * Returns true if the current touch situation should be interpreted as inverted, false if not. * * @return */ private boolean inverted() { return (mClosestDataSetToTouch == null && mChart.isAnyAxisInverted()) || (mClosestDataSetToTouch != null && mChart.isInverted(mClosestDataSetToTouch.getAxisDependency())); }
/** * Returns true if the current touch situation should be interpreted as inverted, false if not. * * @return */ private boolean inverted() { return (mClosestDataSetToTouch == null && mChart.isAnyAxisInverted()) || (mClosestDataSetToTouch != null && mChart.isInverted(mClosestDataSetToTouch.getAxisDependency())); }
/** * Returns true if the current touch situation should be interpreted as inverted, false if not. * * @return */ private boolean inverted() { return (mClosestDataSetToTouch == null && mChart.isAnyAxisInverted()) || (mClosestDataSetToTouch != null && mChart.isInverted(mClosestDataSetToTouch.getAxisDependency())); }
/** * Returns true if the current touch situation should be interpreted as inverted, false if not. * * @return */ private boolean inverted() { return (mClosestDataSetToTouch == null && mChart.isAnyAxisInverted()) || (mClosestDataSetToTouch != null && mChart.isInverted(mClosestDataSetToTouch.getAxisDependency())); }