Package 

Interface IDataSet

    • Method Summary

      Modifier and Type Method Description
      abstract float getYMin() returns the minimum y-value this DataSet holds
      abstract float getYMax() returns the maximum y-value this DataSet holds
      abstract float getXMin() returns the minimum x-value this DataSet holds
      abstract float getXMax() returns the maximum x-value this DataSet holds
      abstract int getEntryCount() Returns the number of y-values this DataSet represents -> the size of the y-values array-> yvals.
      abstract void calcMinMax() Calculates the minimum and maximum x and y values (mXMin, mXMax, mYMin, mYMax).
      abstract void calcMinMaxY(float fromX, float toX) Calculates the min and max y-values from the Entry closest to the given fromX to the Entry closest to the given toX value.This is only needed for the autoScaleMinMax feature.
      abstract T getEntryForXValue(float xValue, float closestToY, DataSet.Rounding rounding) Returns the first Entry object found at the given x-value with binarysearch.If the no Entry at the specified x-value is found, this methodreturns the Entry at the closest x-value according to the rounding.INFORMATION: This method does calculations at runtime.
      abstract T getEntryForXValue(float xValue, float closestToY) Returns the first Entry object found at the given x-value with binarysearch.If the no Entry at the specified x-value is found, this methodreturns the Entry at the closest x-value.INFORMATION: This method does calculations at runtime.
      abstract List<T> getEntriesForXValue(float xValue) Returns all Entry objects found at the given x-value with binarysearch.
      abstract T getEntryForIndex(int index) Returns the Entry object found at the given index (NOT xIndex) in the values array.
      abstract int getEntryIndex(float xValue, float closestToY, DataSet.Rounding rounding) Returns the first Entry index found at the given x-value with binarysearch.If the no Entry at the specified x-value is found, this methodreturns the Entry at the closest x-value according to the rounding.INFORMATION: This method does calculations at runtime.
      abstract int getEntryIndex(T e) Returns the position of the provided entry in the DataSets Entry array.Returns -1 if doesn't exist.
      abstract int getIndexInEntries(int xIndex) This method returns the actualindex in the Entry array of the DataSet for a given xIndex.
      abstract boolean addEntry(T e) Adds an Entry to the DataSet dynamically.Entries are added to the end of the list.This will also recalculate the current minimum and maximumvalues of the DataSet and the value-sum.
      abstract void addEntryOrdered(T e) Adds an Entry to the DataSet dynamically.Entries are added to their appropriate index in the values array respective to their x-position.This will also recalculate the current minimum and maximumvalues of the DataSet and the value-sum.
      abstract boolean removeFirst() Removes the first Entry (at index 0) of this DataSet from the entries array.Returns true if successful, false if not.
      abstract boolean removeLast() Removes the last Entry (at index size-1) of this DataSet from the entries array.Returns true if successful, false if not.
      abstract boolean removeEntry(T e) Removes an Entry from the DataSets entries array.
      abstract boolean removeEntryByXValue(float xValue) Removes the Entry object closest to the given x-value from the DataSet.Returns true if an Entry was removed, false if no Entry could be removed.
      abstract boolean removeEntry(int index) Removes the Entry object at the given index in the values array from the DataSet.Returns true if an Entry was removed, false if no Entry could be removed.
      abstract boolean contains(T entry) Checks if this DataSet contains the specified Entry.
      abstract void clear() Removes all values from this DataSet and does all necessary recalculations.
      abstract String getLabel() Returns the label string that describes the DataSet.
      abstract void setLabel(String label) Sets the label string that describes the DataSet.
      abstract YAxis.AxisDependency getAxisDependency() Returns the axis this DataSet should be plotted against.
      abstract void setAxisDependency(YAxis.AxisDependency dependency) Set the y-axis this DataSet should be plotted against (either LEFT orRIGHT).
      abstract List<Integer> getColors() returns all the colors that are set for this DataSet
      abstract int getColor() Returns the first color (index 0) of the colors-array this DataSetcontains.
      abstract int getColor(int index) Returns the color at the given index of the DataSet's color array.Performs a IndexOutOfBounds check by modulus.
      abstract boolean isHighlightEnabled() returns true if highlighting of values is enabled, false if not
      abstract void setHighlightEnabled(boolean enabled) If set to true, value highlighting is enabled which means that values canbe highlighted programmatically or by touch gesture.
      abstract void setValueFormatter(IValueFormatter f) Sets the formatter to be used for drawing the values inside the chart.
      abstract IValueFormatter getValueFormatter() Returns the formatter used for drawing the values inside the chart.
      abstract boolean needsFormatter() Returns true if the valueFormatter object of this DataSet is null.
      abstract void setValueTextColor(int color) Sets the color the value-labels of this DataSet should have.
      abstract void setValueTextColors(List<Integer> colors) Sets a list of colors to be used as the colors for the drawn values.
      abstract void setValueTypeface(Typeface tf) Sets a Typeface for the value-labels of this DataSet.
      abstract void setValueTextSize(float size) Sets the text-size of the value-labels of this DataSet in dp.
      abstract int getValueTextColor() Returns only the first color of all colors that are set to be used for the values.
      abstract int getValueTextColor(int index) Returns the color at the specified index that is used for drawing the values inside the chart.Uses modulus internally.
      abstract Typeface getValueTypeface() Returns the typeface that is used for drawing the values inside the chart
      abstract float getValueTextSize() Returns the text size that is used for drawing the values inside the chart
      abstract Legend.LegendForm getForm() The form to draw for this dataset in the legend.
      abstract float getFormSize() The form size to draw for this dataset in the legend.
      abstract float getFormLineWidth() The line width for drawing the form of this dataset in the legendReturn `Float.NaN` to use the default legend form line width.
      abstract DashPathEffect getFormLineDashEffect() The line dash path effect used for shapes that consist of lines.
      abstract void setDrawValues(boolean enabled) set this to true to draw y-values on the chart.
      abstract boolean isDrawValuesEnabled() Returns true if y-value drawing is enabled, false if not
      abstract void setDrawIcons(boolean enabled) Set this to true to draw y-icons on the chart.
      abstract boolean isDrawIconsEnabled() Returns true if y-icon drawing is enabled, false if not
      abstract void setIconsOffset(MPPointF offset) Offset of icons drawn on the chart.For all charts except Pie and Radar it will be ordinary (x offset,y offset).For Pie and Radar chart it will be (y offset, distance from center offset); so if you want icon to be rendered under value, you should increase X component of CGPoint, and if you want icon to be rendered closet to center, you should decrease height component of CGPoint.
      abstract MPPointF getIconsOffset() Get the offset for drawing icons.
      abstract void setVisible(boolean visible) Set the visibility of this DataSet.
      abstract boolean isVisible() Returns true if this DataSet is visible inside the chart, or false if itis currently hidden.
      • Methods inherited from class java.lang.Object

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

      • getYMin

         abstract float getYMin()

        returns the minimum y-value this DataSet holds

      • getYMax

         abstract float getYMax()

        returns the maximum y-value this DataSet holds

      • getXMin

         abstract float getXMin()

        returns the minimum x-value this DataSet holds

      • getXMax

         abstract float getXMax()

        returns the maximum x-value this DataSet holds

      • getEntryCount

         abstract int getEntryCount()

        Returns the number of y-values this DataSet represents -> the size of the y-values array-> yvals.size()

      • calcMinMax

         abstract void calcMinMax()

        Calculates the minimum and maximum x and y values (mXMin, mXMax, mYMin, mYMax).

      • calcMinMaxY

         abstract void calcMinMaxY(float fromX, float toX)

        Calculates the min and max y-values from the Entry closest to the given fromX to the Entry closest to the given toX value.This is only needed for the autoScaleMinMax feature.

      • getEntryForXValue

         abstract T getEntryForXValue(float xValue, float closestToY, DataSet.Rounding rounding)

        Returns the first Entry object found at the given x-value with binarysearch.If the no Entry at the specified x-value is found, this methodreturns the Entry at the closest x-value according to the rounding.INFORMATION: This method does calculations at runtime. Donot over-use in performance critical situations.

        Parameters:
        xValue - the x-value
        closestToY - If there are multiple y-values for the specified x-value,
        rounding - determine whether to round up/down/closestif there is no Entry matching the provided x-value
      • getEntryForXValue

         abstract T getEntryForXValue(float xValue, float closestToY)

        Returns the first Entry object found at the given x-value with binarysearch.If the no Entry at the specified x-value is found, this methodreturns the Entry at the closest x-value.INFORMATION: This method does calculations at runtime. Donot over-use in performance critical situations.

        Parameters:
        xValue - the x-value
        closestToY - If there are multiple y-values for the specified x-value,
      • getEntriesForXValue

         abstract List<T> getEntriesForXValue(float xValue)

        Returns all Entry objects found at the given x-value with binarysearch. An empty array if no Entry object at that x-value.INFORMATION: This method does calculations at runtime. Donot over-use in performance critical situations.

      • getEntryForIndex

         abstract T getEntryForIndex(int index)

        Returns the Entry object found at the given index (NOT xIndex) in the values array.

      • getEntryIndex

         abstract int getEntryIndex(float xValue, float closestToY, DataSet.Rounding rounding)

        Returns the first Entry index found at the given x-value with binarysearch.If the no Entry at the specified x-value is found, this methodreturns the Entry at the closest x-value according to the rounding.INFORMATION: This method does calculations at runtime. Donot over-use in performance critical situations.

        Parameters:
        xValue - the x-value
        closestToY - If there are multiple y-values for the specified x-value,
        rounding - determine whether to round up/down/closestif there is no Entry matching the provided x-value
      • getEntryIndex

         abstract int getEntryIndex(T e)

        Returns the position of the provided entry in the DataSets Entry array.Returns -1 if doesn't exist.

      • getIndexInEntries

         abstract int getIndexInEntries(int xIndex)

        This method returns the actualindex in the Entry array of the DataSet for a given xIndex. IMPORTANT: This method doescalculations at runtime, do not over-use in performance criticalsituations.

      • addEntry

         abstract boolean addEntry(T e)

        Adds an Entry to the DataSet dynamically.Entries are added to the end of the list.This will also recalculate the current minimum and maximumvalues of the DataSet and the value-sum.

      • addEntryOrdered

         abstract void addEntryOrdered(T e)

        Adds an Entry to the DataSet dynamically.Entries are added to their appropriate index in the values array respective to their x-position.This will also recalculate the current minimum and maximumvalues of the DataSet and the value-sum.

      • removeFirst

         abstract boolean removeFirst()

        Removes the first Entry (at index 0) of this DataSet from the entries array.Returns true if successful, false if not.

      • removeLast

         abstract boolean removeLast()

        Removes the last Entry (at index size-1) of this DataSet from the entries array.Returns true if successful, false if not.

      • removeEntry

         abstract boolean removeEntry(T e)

        Removes an Entry from the DataSets entries array. This will alsorecalculate the current minimum and maximum values of the DataSet and thevalue-sum. Returns true if an Entry was removed, false if no Entry couldbe removed.

      • removeEntryByXValue

         abstract boolean removeEntryByXValue(float xValue)

        Removes the Entry object closest to the given x-value from the DataSet.Returns true if an Entry was removed, false if no Entry could be removed.

      • removeEntry

         abstract boolean removeEntry(int index)

        Removes the Entry object at the given index in the values array from the DataSet.Returns true if an Entry was removed, false if no Entry could be removed.

      • contains

         abstract boolean contains(T entry)

        Checks if this DataSet contains the specified Entry. Returns true if so,false if not. NOTE: Performance is pretty bad on this one, do notover-use in performance critical situations.

      • clear

         abstract void clear()

        Removes all values from this DataSet and does all necessary recalculations.

      • getLabel

         abstract String getLabel()

        Returns the label string that describes the DataSet.

      • setLabel

         abstract void setLabel(String label)

        Sets the label string that describes the DataSet.

      • getColor

         abstract int getColor()

        Returns the first color (index 0) of the colors-array this DataSetcontains. This is only used for performance reasons when only one color is in the colors array (size == 1)

      • getColor

         abstract int getColor(int index)

        Returns the color at the given index of the DataSet's color array.Performs a IndexOutOfBounds check by modulus.

      • isHighlightEnabled

         abstract boolean isHighlightEnabled()

        returns true if highlighting of values is enabled, false if not

      • setHighlightEnabled

         abstract void setHighlightEnabled(boolean enabled)

        If set to true, value highlighting is enabled which means that values canbe highlighted programmatically or by touch gesture.

      • setValueFormatter

         abstract void setValueFormatter(IValueFormatter f)

        Sets the formatter to be used for drawing the values inside the chart. Ifno formatter is set, the chart will automatically determine a reasonableformatting (concerning decimals) for all the values that are drawn insidethe chart. Use chart.getDefaultValueFormatter() to use the formattercalculated by the chart.

      • needsFormatter

         abstract boolean needsFormatter()

        Returns true if the valueFormatter object of this DataSet is null.

      • setValueTextColor

         abstract void setValueTextColor(int color)

        Sets the color the value-labels of this DataSet should have.

      • setValueTextColors

         abstract void setValueTextColors(List<Integer> colors)

        Sets a list of colors to be used as the colors for the drawn values.

      • setValueTextSize

         abstract void setValueTextSize(float size)

        Sets the text-size of the value-labels of this DataSet in dp.

      • getValueTextColor

         abstract int getValueTextColor()

        Returns only the first color of all colors that are set to be used for the values.

      • getValueTextColor

         abstract int getValueTextColor(int index)

        Returns the color at the specified index that is used for drawing the values inside the chart.Uses modulus internally.

      • getValueTypeface

         abstract Typeface getValueTypeface()

        Returns the typeface that is used for drawing the values inside the chart

      • getValueTextSize

         abstract float getValueTextSize()

        Returns the text size that is used for drawing the values inside the chart

      • getForm

         abstract Legend.LegendForm getForm()

        The form to draw for this dataset in the legend.

        Return `DEFAULT` to use the default legend form.
      • getFormSize

         abstract float getFormSize()

        The form size to draw for this dataset in the legend.

        Return `Float.NaN` to use the default legend form size.
      • getFormLineWidth

         abstract float getFormLineWidth()

        The line width for drawing the form of this dataset in the legend

        Return `Float.NaN` to use the default legend form line width.
      • getFormLineDashEffect

         abstract DashPathEffect getFormLineDashEffect()

        The line dash path effect used for shapes that consist of lines.

        Return `null` to use the default legend form line dash effect.
      • setDrawValues

         abstract void setDrawValues(boolean enabled)

        set this to true to draw y-values on the chart.NOTE (for bar and line charts): if `maxVisibleCount` is reached, no values will be drawn evenif this is enabled

      • isDrawValuesEnabled

         abstract boolean isDrawValuesEnabled()

        Returns true if y-value drawing is enabled, false if not

      • setDrawIcons

         abstract void setDrawIcons(boolean enabled)

        Set this to true to draw y-icons on the chart.NOTE (for bar and line charts): if `maxVisibleCount` is reached, no icons will be drawn evenif this is enabled

      • isDrawIconsEnabled

         abstract boolean isDrawIconsEnabled()

        Returns true if y-icon drawing is enabled, false if not

      • setIconsOffset

         abstract void setIconsOffset(MPPointF offset)

        Offset of icons drawn on the chart.For all charts except Pie and Radar it will be ordinary (x offset,y offset).For Pie and Radar chart it will be (y offset, distance from center offset); so if you want icon to be rendered under value, you should increase X component of CGPoint, and if you want icon to be rendered closet to center, you should decrease height component of CGPoint.

      • setVisible

         abstract void setVisible(boolean visible)

        Set the visibility of this DataSet. If not visible, the DataSet will notbe drawn to the chart upon refreshing it.

      • isVisible

         abstract boolean isVisible()

        Returns true if this DataSet is visible inside the chart, or false if itis currently hidden.