/** * The PieData object can only have one DataSet. Use getDataSet() method instead. * * @param index * @return */ @Override public IPieDataSet getDataSetByIndex(int index) { return index == 0 ? getDataSet() : null; }
/** * Returns the sum of all values in this PieData object. * * @return */ public float getYValueSum() { float sum = 0; for (int i = 0; i < getDataSet().getEntryCount(); i++) sum += getDataSet().getEntryForIndex(i).getY(); return sum; } }
@Override public Entry getEntryForHighlight(Highlight highlight) { return getDataSet().getEntryForIndex((int) highlight.getX()); }
@Override public void calculateOffsets() { super.calculateOffsets(); // prevent nullpointer when no data set if (mData == null) return; float diameter = getDiameter(); float radius = diameter / 2f; MPPointF c = getCenterOffsets(); float shift = mData.getDataSet().getSelectionShift(); // create the circle box that will contain the pie-chart (the bounds of // the pie-chart) mCircleBox.set(c.x - radius + shift, c.y - radius + shift, c.x + radius - shift, c.y + radius - shift); MPPointF.recycleInstance(c); }
@Override protected Highlight getClosestHighlight(int index, float x, float y) { IPieDataSet set = mChart.getData().getDataSet(); final Entry entry = set.getEntryForIndex(index); return new Highlight(index, entry.getY(), x, y, 0, set.getAxisDependency()); } }
return; IPieDataSet dataSet = mChart.getData().getDataSet();
/** * The PieData object can only have one DataSet. Use getDataSet() method instead. * * @param index * @return */ @Override public IPieDataSet getDataSetByIndex(int index) { return index == 0 ? getDataSet() : null; }
/** * The PieData object can only have one DataSet. Use getDataSet() method instead. * * @param index * @return */ @Override public IPieDataSet getDataSetByIndex(int index) { return index == 0 ? getDataSet() : null; }
/** * The PieData object can only have one DataSet. Use getDataSet() method instead. * * @param index * @return */ @Override public IPieDataSet getDataSetByIndex(int index) { return index == 0 ? getDataSet() : null; }
/** * The PieData object can only have one DataSet. Use getDataSet() method instead. * * @param index * @return */ @Override public IPieDataSet getDataSetByIndex(int index) { return index == 0 ? getDataSet() : null; }
/** * Returns the sum of all values in this PieData object. * * @return */ public float getYValueSum() { float sum = 0; for (int i = 0; i < getDataSet().getEntryCount(); i++) sum += getDataSet().getEntryForIndex(i).getY(); return sum; } }
/** * Returns the sum of all values in this PieData object. * * @return */ public float getYValueSum() { float sum = 0; for (int i = 0; i < getDataSet().getEntryCount(); i++) sum += getDataSet().getEntryForIndex(i).getY(); return sum; } }
/** * Returns the sum of all values in this PieData object. * * @return */ public float getYValueSum() { float sum = 0; for (int i = 0; i < getDataSet().getEntryCount(); i++) sum += getDataSet().getEntryForIndex(i).getY(); return sum; } }
/** * Returns the sum of all values in this PieData object. * * @return */ public float getYValueSum() { float sum = 0; for (int i = 0; i < getDataSet().getEntryCount(); i++) { sum += getDataSet().getEntryForIndex(i).getY(); } return sum; } }
@Override public Entry getEntryForHighlight(Highlight highlight) { return getDataSet().getEntryForIndex((int) highlight.getX()); }
@Override public Entry getEntryForHighlight(Highlight highlight) { return getDataSet().getEntryForIndex((int) highlight.getX()); }
@Override protected Highlight getClosestHighlight(int index, float x, float y) { IPieDataSet set = mChart.getData().getDataSet(); final Entry entry = set.getEntryForIndex(index); return new Highlight(index, entry.getY(), x, y, 0, set.getAxisDependency()); } }
@Override protected Highlight getClosestHighlight(int index, float x, float y) { IPieDataSet set = mChart.getData().getDataSet(); final Entry entry = set.getEntryForIndex(index); return new Highlight(index, entry.getY(), x, y, 0, set.getAxisDependency()); } }
@Override protected Highlight getClosestHighlight(int index, float x, float y) { IPieDataSet set = mChart.getData().getDataSet(); final Entry entry = set.getEntryForIndex(index); return new Highlight(index, entry.getY(), x, y, 0, set.getAxisDependency()); } }
@Override protected Highlight getClosestHighlight(int index, float x, float y) { IPieDataSet set = mChart.getData().getDataSet(); final Entry entry = set.getEntryForIndex(index); return new Highlight(index, entry.getY(), x, y, 0, set.getAxisDependency()); } }