/** * Returns the center value of the candle. (Middle value between high and * low) */ @Override public float getY() { return super.getY(); }
/** * Returns the value of this BarEntry. If the entry is stacked, it returns the positive sum of all values. * * @return */ @Override public float getY() { return super.getY(); }
/** * returns a string representation of the entry containing x-index and value */ @Override public String toString() { return "Entry, x: " + x + " y: " + getY(); }
/** * Used to draw line and scatter labels, calls {@link #getFormattedValue(float)} by default. * * @param entry point being labeled, contains X value * @return formatted string label */ public String getPointLabel(Entry entry) { return getFormattedValue(entry.getY()); }
@Override public void refreshContent(Entry e, Highlight highlight) { tvContent.setText(String.format("%s %%", format.format(e.getY()))); super.refreshContent(e, highlight); }
@Override public void onValueSelected(Entry e, Highlight h) { Log.i("VAL SELECTED", "Value: " + e.getY() + ", xIndex: " + e.getX() + ", DataSet index: " + h.getDataSetIndex()); }
@Override public void onValueSelected(Entry e, Highlight h) { Log.i("VAL SELECTED", "Value: " + e.getY() + ", xIndex: " + e.getX() + ", DataSet index: " + h.getDataSetIndex()); }
@Override public void onValueSelected(Entry e, Highlight h) { Log.i("VAL SELECTED", "Value: " + e.getY() + ", xIndex: " + e.getX() + ", DataSet index: " + h.getDataSetIndex()); }
@Override public void onValueSelected(Entry e, Highlight h) { if (e == null) return; Log.i("VAL SELECTED", "Value: " + e.getY() + ", index: " + h.getX() + ", DataSet index: " + h.getDataSetIndex()); }
@Override public void onValueSelected(Entry e, Highlight h) { if (e == null) return; Log.i("VAL SELECTED", "Value: " + e.getY() + ", xIndex: " + e.getX() + ", DataSet index: " + h.getDataSetIndex()); }
@Override public void onValueSelected(Entry e, Highlight h) { Log.i("VAL SELECTED", "Value: " + e.getY() + ", xIndex: " + e.getX() + ", DataSet index: " + h.getDataSetIndex()); }
@Override public void onValueSelected(Entry e, Highlight h) { Log.i("VAL SELECTED", "Value: " + e.getY() + ", xIndex: " + e.getX() + ", DataSet index: " + h.getDataSetIndex()); }
@Override public void refreshContent(Entry e, Highlight highlight) { tvContent.setText(String.format("x: %s, y: %s", xAxisValueFormatter.getFormattedValue(e.getX()), format.format(e.getY()))); super.refreshContent(e, highlight); }
/** * returns an exact copy of the entry * * @return */ public Entry copy() { Entry e = new Entry(x, getY(), getData()); return e; }
@Override public void addEntryOrdered(T e) { if (e == null) return; if (mValues == null) { mValues = new ArrayList<T>(); } calcMinMax(e); if (mValues.size() > 0 && mValues.get(mValues.size() - 1).getX() > e.getX()) { int closestIndex = getEntryIndex(e.getX(), e.getY(), Rounding.UP); mValues.add(closestIndex, e); } else { mValues.add(e); } }
@Override public void refreshContent(Entry e, Highlight highlight) { if (e instanceof CandleEntry) { CandleEntry ce = (CandleEntry) e; tvContent.setText(Utils.formatNumber(ce.getHigh(), 0, true)); } else { tvContent.setText(Utils.formatNumber(e.getY(), 0, true)); } super.refreshContent(e, highlight); }
@Override public void refreshContent(Entry e, Highlight highlight) { if (e instanceof BarEntry) { BarEntry be = (BarEntry) e; if(be.getYVals() != null) { // draw the stack value tvContent.setText(Utils.formatNumber(be.getYVals()[highlight.getStackIndex()], 0, true)); } else { tvContent.setText(Utils.formatNumber(be.getY(), 0, true)); } } else { tvContent.setText(Utils.formatNumber(e.getY(), 0, true)); } super.refreshContent(e, highlight); }
@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 public void onValueSelected(Entry e, Highlight h) { Log.i("Entry selected", e.toString()); chart.centerViewToAnimated(e.getX(), e.getY(), chart.getData().getDataSetByIndex(h.getDataSetIndex()) .getAxisDependency(), 500); //chart.zoomAndCenterAnimated(2.5f, 2.5f, e.getX(), e.getY(), chart.getData().getDataSetByIndex(dataSetIndex) // .getAxisDependency(), 1000); //chart.zoomAndCenterAnimated(1.8f, 1.8f, e.getX(), e.getY(), chart.getData().getDataSetByIndex(dataSetIndex) // .getAxisDependency(), 1000); }