/** * Sets colors with a specific alpha value. * * @param colors * @param alpha */ public void setColors(int[] colors, int alpha) { resetColors(); for (int color : colors) { addColor(Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color))); } }
/** * Use this method to tell the data set that the underlying data has changed. */ public void notifyDataSetChanged() { calcMinMax(); }
@Override public boolean removeFirst() { if (getEntryCount() > 0) { T entry = getEntryForIndex(0); return removeEntry(entry); } else return false; }
@Override public boolean removeEntry(int index) { T e = getEntryForIndex(index); return removeEntry(e); }
@Override public boolean removeEntryByXValue(float xValue) { T e = getEntryForXValue(xValue, Float.NaN); return removeEntry(e); }
@Override public boolean contains(T e) { for (int i = 0; i < getEntryCount(); i++) { if (getEntryForIndex(i).equals(e)) return true; } return false; }
/** * Sets a color with a specific alpha value. * * @param color * @param alpha from 0-255 */ public void setColor(int color, int alpha) { setColor(Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color))); }
@Override public ValueFormatter getValueFormatter() { if (needsFormatter()) return Utils.getDefaultValueFormatter(); return mValueFormatter; }
/** * Sets the one and ONLY color that should be used for this DataSet. * Internally, this recreates the colors array and adds the specified color. * * @param color */ public void setColor(int color) { resetColors(); mColors.add(color); }
/** * * @param dataSet */ protected void copy(DataSet dataSet) { super.copy(dataSet); }
/** * ###### ###### DATA RELATED METHODS ###### ###### */ @Override public int getIndexInEntries(int xIndex) { for (int i = 0; i < getEntryCount(); i++) { if (xIndex == getEntryForIndex(i).getX()) return i; } return -1; }
@Override public boolean removeEntry(int index) { T e = getEntryForIndex(index); return removeEntry(e); }
@Override public boolean removeEntryByXValue(float xValue) { T e = getEntryForXValue(xValue, Float.NaN); return removeEntry(e); }
/** * Sets a color with a specific alpha value. * * @param color * @param alpha from 0-255 */ public void setColor(int color, int alpha) { setColor(Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color))); }
@Override public IValueFormatter getValueFormatter() { if (needsFormatter()) { return Utils.getDefaultValueFormatter(); } return mValueFormatter; }
/** * Sets the one and ONLY color that should be used for this DataSet. * Internally, this recreates the colors array and adds the specified color. * * @param color */ public void setColor(int color) { resetColors(); mColors.add(color); }
/** * * @param dataSet */ protected void copy(DataSet dataSet) { super.copy(dataSet); }
@Override public boolean removeLast() { if (getEntryCount() > 0) { T e = getEntryForIndex(getEntryCount() - 1); return removeEntry(e); } else return false; }
@Override public boolean contains(T e) { for (int i = 0; i < getEntryCount(); i++) { if (getEntryForIndex(i).equals(e)) return true; } return false; } }
@Override public boolean removeEntry(int index) { T e = getEntryForIndex(index); return removeEntry(e); }