-
-
Method Summary
Modifier and Type Method Description abstract floatgetYMin()returns the minimum y-value this DataSet holds abstract floatgetYMax()returns the maximum y-value this DataSet holds abstract floatgetXMin()returns the minimum x-value this DataSet holds abstract floatgetXMax()returns the maximum x-value this DataSet holds abstract intgetEntryCount()Returns the number of y-values this DataSet represents -> the size of the y-values array-> yvals. abstract voidcalcMinMax()Calculates the minimum and maximum x and y values (mXMin, mXMax, mYMin, mYMax). abstract voidcalcMinMaxY(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 TgetEntryForXValue(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 TgetEntryForXValue(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 TgetEntryForIndex(int index)Returns the Entry object found at the given index (NOT xIndex) in the values array. abstract intgetEntryIndex(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 intgetEntryIndex(T e)Returns the position of the provided entry in the DataSets Entry array.Returns -1 if doesn't exist. abstract intgetIndexInEntries(int xIndex)This method returns the actualindex in the Entry array of the DataSet for a given xIndex. abstract booleanaddEntry(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 voidaddEntryOrdered(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 booleanremoveFirst()Removes the first Entry (at index 0) of this DataSet from the entries array.Returns true if successful, false if not. abstract booleanremoveLast()Removes the last Entry (at index size-1) of this DataSet from the entries array.Returns true if successful, false if not. abstract booleanremoveEntry(T e)Removes an Entry from the DataSets entries array. abstract booleanremoveEntryByXValue(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 booleanremoveEntry(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 booleancontains(T entry)Checks if this DataSet contains the specified Entry. abstract voidclear()Removes all values from this DataSet and does all necessary recalculations. abstract StringgetLabel()Returns the label string that describes the DataSet. abstract voidsetLabel(String label)Sets the label string that describes the DataSet. abstract YAxis.AxisDependencygetAxisDependency()Returns the axis this DataSet should be plotted against. abstract voidsetAxisDependency(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 intgetColor()Returns the first color (index 0) of the colors-array this DataSetcontains. abstract intgetColor(int index)Returns the color at the given index of the DataSet's color array.Performs a IndexOutOfBounds check by modulus. abstract booleanisHighlightEnabled()returns true if highlighting of values is enabled, false if not abstract voidsetHighlightEnabled(boolean enabled)If set to true, value highlighting is enabled which means that values canbe highlighted programmatically or by touch gesture. abstract voidsetValueFormatter(IValueFormatter f)Sets the formatter to be used for drawing the values inside the chart. abstract IValueFormattergetValueFormatter()Returns the formatter used for drawing the values inside the chart. abstract booleanneedsFormatter()Returns true if the valueFormatter object of this DataSet is null. abstract voidsetValueTextColor(int color)Sets the color the value-labels of this DataSet should have. abstract voidsetValueTextColors(List<Integer> colors)Sets a list of colors to be used as the colors for the drawn values. abstract voidsetValueTypeface(Typeface tf)Sets a Typeface for the value-labels of this DataSet. abstract voidsetValueTextSize(float size)Sets the text-size of the value-labels of this DataSet in dp. abstract intgetValueTextColor()Returns only the first color of all colors that are set to be used for the values. abstract intgetValueTextColor(int index)Returns the color at the specified index that is used for drawing the values inside the chart.Uses modulus internally. abstract TypefacegetValueTypeface()Returns the typeface that is used for drawing the values inside the chart abstract floatgetValueTextSize()Returns the text size that is used for drawing the values inside the chart abstract Legend.LegendFormgetForm()The form to draw for this dataset in the legend. abstract floatgetFormSize()The form size to draw for this dataset in the legend. abstract floatgetFormLineWidth()The line width for drawing the form of this dataset in the legendReturn `Float.NaN` to use the default legend form line width. abstract DashPathEffectgetFormLineDashEffect()The line dash path effect used for shapes that consist of lines. abstract voidsetDrawValues(boolean enabled)set this to true to draw y-values on the chart. abstract booleanisDrawValuesEnabled()Returns true if y-value drawing is enabled, false if not abstract voidsetDrawIcons(boolean enabled)Set this to true to draw y-icons on the chart. abstract booleanisDrawIconsEnabled()Returns true if y-icon drawing is enabled, false if not abstract voidsetIconsOffset(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 MPPointFgetIconsOffset()Get the offset for drawing icons. abstract voidsetVisible(boolean visible)Set the visibility of this DataSet. abstract booleanisVisible()Returns true if this DataSet is visible inside the chart, or false if itis currently hidden. -
-
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-valueclosestToY- 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-valueclosestToY- 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-valueclosestToY- 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.
-
getAxisDependency
abstract YAxis.AxisDependency getAxisDependency()
Returns the axis this DataSet should be plotted against.
-
setAxisDependency
abstract void setAxisDependency(YAxis.AxisDependency dependency)
Set the y-axis this DataSet should be plotted against (either LEFT orRIGHT). Default: LEFT
-
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.
-
getValueFormatter
abstract IValueFormatter getValueFormatter()
Returns the formatter used for drawing the values inside 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.
-
setValueTypeface
abstract void setValueTypeface(Typeface tf)
Sets a Typeface for the value-labels of this DataSet.
-
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.
-
getIconsOffset
abstract MPPointF getIconsOffset()
Get the offset for drawing icons.
-
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.
-
-
-
-