Tabnine Logo
com.github.mikephil.charting.data
Code IndexAdd Tabnine to your IDE (free)

How to use com.github.mikephil.charting.data

Best Java code snippets using com.github.mikephil.charting.data (Showing top 20 results out of 333)

origin: PhilJay/MPAndroidChart

/**
 * ###### ###### 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;
}
origin: PhilJay/MPAndroidChart

@Override
protected void calcMinMax(CandleEntry e) {
  if (e.getLow() < mYMin)
    mYMin = e.getLow();
  if (e.getHigh() > mYMax)
    mYMax = e.getHigh();
  calcMinMaxX(e);
}
origin: PhilJay/MPAndroidChart

@Override
protected void calcMinMax(BubbleEntry e) {
  super.calcMinMax(e);
  final float size = e.getSize();
  if (size > mMaxSize) {
    mMaxSize = size;
  }
}
origin: PhilJay/MPAndroidChart

/**
 * returns an exact copy of the entry
 * 
 * @return
 */
public Entry copy() {
  Entry e = new Entry(x, getY(), getData());
  return e;
}
origin: PhilJay/MPAndroidChart

/**
 * Returns an exact copy of the BarEntry.
 */
public BarEntry copy() {
  BarEntry copied = new BarEntry(getX(), getY(), getData());
  copied.setVals(mYVals);
  return copied;
}
origin: PhilJay/MPAndroidChart

@Override
public void notifyDataChanged() {
  if (mLineData != null)
    mLineData.notifyDataChanged();
  if (mBarData != null)
    mBarData.notifyDataChanged();
  if (mCandleData != null)
    mCandleData.notifyDataChanged();
  if (mScatterData != null)
    mScatterData.notifyDataChanged();
  if (mBubbleData != null)
    mBubbleData.notifyDataChanged();
  calcMinMax(); // recalculate everything
}
origin: PhilJay/MPAndroidChart

/**
 * 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();
}
origin: PhilJay/MPAndroidChart

/**
 * Set the array of values this BarEntry should represent.
 *
 * @param vals
 */
public void setVals(float[] vals) {
  setY(calcSum(vals));
  mYVals = vals;
  calcPosNegSum();
  calcRanges();
}
origin: PhilJay/MPAndroidChart

@Override
public boolean removeFirst() {
  if (getEntryCount() > 0) {
    T entry = getEntryForIndex(0);
    return removeEntry(entry);
  } else
    return false;
}
origin: PhilJay/MPAndroidChart

@Override
public boolean removeDataSet(IBarLineScatterCandleBubbleDataSet<? extends Entry> d) {
  List<BarLineScatterCandleBubbleData> datas = getAllData();
  boolean success = false;
  for (ChartData data : datas) {
    success = data.removeDataSet(d);
    if (success) {
      break;
    }
  }
  return success;
}
origin: PhilJay/MPAndroidChart

/**
 * Updates the min and max x and y value of this DataSet based on the given Entry.
 *
 * @param e
 */
protected void calcMinMax(T e) {
  if (e == null)
    return;
  calcMinMaxX(e);
  calcMinMaxY(e);
}
origin: PhilJay/MPAndroidChart

/**
 * Enables / disables both vertical and horizontal highlight-indicators.
 * @param enabled
 */
public void setDrawHighlightIndicators(boolean enabled) {
  setDrawVerticalHighlightIndicator(enabled);
  setDrawHorizontalHighlightIndicator(enabled);
}
origin: PhilJay/MPAndroidChart

/**
 * Constructor taking single or multiple DataSet objects.
 *
 * @param dataSets
 */
public ChartData(T... dataSets) {
  mDataSets = arrayToList(dataSets);
  notifyDataChanged();
}
origin: PhilJay/MPAndroidChart

/**
 * Call this method to let the ChartData know that the underlying data has
 * changed. Calling this performs all necessary recalculations needed when
 * the contained data has changed.
 */
public void notifyDataChanged() {
  calcMinMax();
}
origin: PhilJay/MPAndroidChart

/**
 * Sets the ScatterShape this DataSet should be drawn with. This will search for an available IShapeRenderer and set this
 * renderer for the DataSet.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
  mShapeRenderer = getRendererForShape(shape);
}
origin: PhilJay/MPAndroidChart

@Override
protected void calcMinMax(PieEntry e) {
  if (e == null)
    return;
  calcMinMaxY(e);
}
origin: PhilJay/MPAndroidChart

/**
 * returns the current y-max value across all DataSets
 *
 * @return
 */
public float getYMax() {
  return mData.getYMax();
}
origin: PhilJay/MPAndroidChart

  protected void copy(LineScatterCandleRadarDataSet lineScatterCandleRadarDataSet) {
    super.copy(lineScatterCandleRadarDataSet);
    lineScatterCandleRadarDataSet.mDrawHorizontalHighlightIndicator = mDrawHorizontalHighlightIndicator;
    lineScatterCandleRadarDataSet.mDrawVerticalHighlightIndicator = mDrawVerticalHighlightIndicator;
    lineScatterCandleRadarDataSet.mHighlightLineWidth = mHighlightLineWidth;
    lineScatterCandleRadarDataSet.mHighlightDashPathEffect = mHighlightDashPathEffect;
  }
}
origin: PhilJay/MPAndroidChart

/**
 *
 * @param dataSet
 */
protected void copy(DataSet dataSet) {
  super.copy(dataSet);
}
origin: PhilJay/MPAndroidChart

protected void copy(BarDataSet barDataSet) {
  super.copy(barDataSet);
  barDataSet.mStackSize = mStackSize;
  barDataSet.mBarShadowColor = mBarShadowColor;
  barDataSet.mBarBorderWidth = mBarBorderWidth;
  barDataSet.mStackLabels = mStackLabels;
  barDataSet.mHighLightAlpha = mHighLightAlpha;
}
com.github.mikephil.charting.data

Most used classes

  • Entry
    Class representing one entry in the chart. Might contain multiple values. Might only contain a singl
  • LineData
    Data object that encapsulates all data associated with a LineChart.
  • LineDataSet
  • BarData
    Data object that represents all data for the BarChart.
  • BarDataSet
  • PieData,
  • PieDataSet,
  • CombinedData,
  • PieEntry,
  • ScatterData,
  • ScatterDataSet,
  • CandleEntry,
  • ChartData,
  • RadarData,
  • RadarDataSet,
  • RadarEntry,
  • Approximator,
  • BubbleData,
  • BubbleDataSet
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now