Package 

Class BarEntry

  • All Implemented Interfaces:
    android.os.Parcelable , java.io.Serializable

    
    public class BarEntry
    extends Entry
                        

    Entry class for the BarChart. (especially stacked bars)

    • Constructor Summary

      Constructors 
      Constructor Description
      BarEntry(float x, float y) Constructor for normal bars (not stacked).
      BarEntry(float x, float y, Object data) Constructor for normal bars (not stacked).
      BarEntry(float x, float y, Drawable icon) Constructor for normal bars (not stacked).
      BarEntry(float x, float y, Drawable icon, Object data) Constructor for normal bars (not stacked).
      BarEntry(float x, Array<float> vals) Constructor for stacked bar entries.
      BarEntry(float x, Array<float> vals, Object data) Constructor for stacked bar entries.
      BarEntry(float x, Array<float> vals, Drawable icon) Constructor for stacked bar entries.
      BarEntry(float x, Array<float> vals, Drawable icon, Object data) Constructor for stacked bar entries.
    • Method Summary

      Modifier and Type Method Description
      BarEntry copy() Returns an exact copy of the BarEntry.
      Array<float> getYVals() Returns the stacked values this BarEntry represents, or null, if only a single value is represented (then, usegetY()).
      void setVals(Array<float> vals) Set the array of values this BarEntry should represent.
      float getY() Returns the value of this BarEntry.
      Array<Range> getRanges() Returns the ranges of the individual stack-entries.
      boolean isStacked() Returns true if this BarEntry is stacked (has a values array), false if not.
      float getBelowSum(int stackIndex) Use `getSumBelow(stackIndex)` instead.
      float getSumBelow(int stackIndex)
      float getPositiveSum() Reuturns the sum of all positive values this entry (if stacked) contains.
      float getNegativeSum() Returns the sum of all negative values this entry (if stacked) contains.
      • Methods inherited from class com.github.mikephil.charting.data.Entry

        copy, describeContents, equalTo, getX, setX, toString, writeToParcel
      • Methods inherited from class com.github.mikephil.charting.data.BaseEntry

        getData, getIcon, getY, setData, setIcon, setY
      • Methods inherited from class android.os.Parcelable

        describeContents, writeToParcel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BarEntry

        BarEntry(float x, float y)
        Constructor for normal bars (not stacked).
      • BarEntry

        BarEntry(float x, float y, Object data)
        Constructor for normal bars (not stacked).
        Parameters:
        data - - Spot for additional data this Entry represents.
      • BarEntry

        BarEntry(float x, float y, Drawable icon)
        Constructor for normal bars (not stacked).
        Parameters:
        icon - - icon image
      • BarEntry

        BarEntry(float x, float y, Drawable icon, Object data)
        Constructor for normal bars (not stacked).
        Parameters:
        icon - - icon image
        data - - Spot for additional data this Entry represents.
      • BarEntry

        BarEntry(float x, Array<float> vals)
        Constructor for stacked bar entries.
        Parameters:
        vals - - the stack values, use at least 2
      • BarEntry

        BarEntry(float x, Array<float> vals, Object data)
        Constructor for stacked bar entries.
        Parameters:
        vals - - the stack values, use at least 2
        data - - Spot for additional data this Entry represents.
      • BarEntry

        BarEntry(float x, Array<float> vals, Drawable icon)
        Constructor for stacked bar entries.
        Parameters:
        vals - - the stack values, use at least 2
        icon - - icon image
      • BarEntry

        BarEntry(float x, Array<float> vals, Drawable icon, Object data)
        Constructor for stacked bar entries.
        Parameters:
        vals - - the stack values, use at least 2
        icon - - icon image
        data - - Spot for additional data this Entry represents.
    • Method Detail

      • copy

         BarEntry copy()

        Returns an exact copy of the BarEntry.

      • getYVals

         Array<float> getYVals()

        Returns the stacked values this BarEntry represents, or null, if only a single value is represented (then, usegetY()).

      • setVals

         void setVals(Array<float> vals)

        Set the array of values this BarEntry should represent.

      • getY

         float getY()

        Returns the value of this BarEntry. If the entry is stacked, it returns the positive sum of all values.

      • getRanges

         Array<Range> getRanges()

        Returns the ranges of the individual stack-entries. Will return null if this entry is not stacked.

      • isStacked

         boolean isStacked()

        Returns true if this BarEntry is stacked (has a values array), false if not.

      • getPositiveSum

         float getPositiveSum()

        Reuturns the sum of all positive values this entry (if stacked) contains.

      • getNegativeSum

         float getNegativeSum()

        Returns the sum of all negative values this entry (if stacked) contains. (this is a positive number)