public abstract class BaseDataSet<T extends Entry> extends java.lang.Object implements IDataSet<T>
| Modifier and Type | Field and Description |
|---|---|
protected YAxis.AxisDependency |
mAxisDependency
this specifies which axis this DataSet should be plotted against
|
protected java.util.List<java.lang.Integer> |
mColors
List representing all colors that are used for this DataSet
|
protected boolean |
mDrawIcons
if true, y-icons are drawn on the chart
|
protected boolean |
mDrawValues
if true, y-values are drawn on the chart
|
protected GradientColor |
mGradientColor |
protected java.util.List<GradientColor> |
mGradientColors |
protected boolean |
mHighlightEnabled
if true, value highlightning is enabled
|
protected MPPointF |
mIconsOffset
the offset for drawing icons (in dp)
|
protected java.util.List<java.lang.Integer> |
mValueColors
List representing all colors that are used for drawing the actual values for this DataSet
|
protected ValueFormatter |
mValueFormatter
custom formatter that is used instead of the auto-formatter if set
|
protected float |
mValueTextSize
the size of the value-text labels
|
protected android.graphics.Typeface |
mValueTypeface
the typeface used for the value text
|
protected boolean |
mVisible
flag that indicates if the DataSet is visible or not
|
| Constructor and Description |
|---|
BaseDataSet()
Default constructor.
|
BaseDataSet(java.lang.String label)
Constructor with label.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColor(int color)
Adds a new color to the colors array of the DataSet.
|
boolean |
contains(T e)
Checks if this DataSet contains the specified Entry.
|
protected void |
copy(BaseDataSet baseDataSet) |
YAxis.AxisDependency |
getAxisDependency()
Returns the axis this DataSet should be plotted against.
|
int |
getColor()
Returns the first color (index 0) of the colors-array this DataSet
contains.
|
int |
getColor(int index)
Returns the color at the given index of the DataSet's color array.
|
java.util.List<java.lang.Integer> |
getColors()
###### ###### COLOR GETTING RELATED METHODS ##### ######
|
Legend.LegendForm |
getForm()
The form to draw for this dataset in the legend.
|
android.graphics.DashPathEffect |
getFormLineDashEffect()
The line dash path effect used for shapes that consist of lines.
|
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.
|
float |
getFormSize()
The form size to draw for this dataset in the legend.
|
GradientColor |
getGradientColor()
Returns the Gradient color model
|
GradientColor |
getGradientColor(int index)
Returns the Gradient colors
|
java.util.List<GradientColor> |
getGradientColors()
Returns the Gradient colors
|
MPPointF |
getIconsOffset()
Get the offset for drawing icons.
|
int |
getIndexInEntries(int xIndex)
###### ###### DATA RELATED METHODS ###### ######
|
java.lang.String |
getLabel()
Returns the label string that describes the DataSet.
|
java.util.List<java.lang.Integer> |
getValueColors() |
ValueFormatter |
getValueFormatter()
Returns the formatter used for drawing the values inside the chart.
|
int |
getValueTextColor()
Returns only the first color of all colors that are set to be used for the values.
|
int |
getValueTextColor(int index)
Returns the color at the specified index that is used for drawing the values inside the chart.
|
float |
getValueTextSize()
Returns the text size that is used for drawing the values inside the chart
|
android.graphics.Typeface |
getValueTypeface()
Returns the typeface that is used for drawing the values inside the chart
|
boolean |
isDrawIconsEnabled()
Returns true if y-icon drawing is enabled, false if not
|
boolean |
isDrawValuesEnabled()
Returns true if y-value drawing is enabled, false if not
|
boolean |
isHighlightEnabled()
returns true if highlighting of values is enabled, false if not
|
boolean |
isVisible()
Returns true if this DataSet is visible inside the chart, or false if it
is currently hidden.
|
boolean |
needsFormatter()
Returns true if the valueFormatter object of this DataSet is null.
|
void |
notifyDataSetChanged()
Use this method to tell the data set that the underlying data has changed.
|
boolean |
removeEntry(int index)
Removes the Entry object at the given index in the values array from the DataSet.
|
boolean |
removeEntryByXValue(float xValue)
Removes the Entry object closest to the given x-value from the DataSet.
|
boolean |
removeFirst()
Removes the first Entry (at index 0) of this DataSet from the entries array.
|
boolean |
removeLast()
Removes the last Entry (at index size-1) of this DataSet from the entries array.
|
void |
resetColors()
Resets all colors of this DataSet and recreates the colors array.
|
void |
setAxisDependency(YAxis.AxisDependency dependency)
Set the y-axis this DataSet should be plotted against (either LEFT or
RIGHT).
|
void |
setColor(int color)
Sets the one and ONLY color that should be used for this DataSet.
|
void |
setColor(int color,
int alpha)
Sets a color with a specific alpha value.
|
void |
setColors(int... colors)
Sets the colors that should be used fore this DataSet.
|
void |
setColors(int[] colors,
android.content.Context c)
Sets the colors that should be used fore this DataSet.
|
void |
setColors(int[] colors,
int alpha)
Sets colors with a specific alpha value.
|
void |
setColors(java.util.List<java.lang.Integer> colors)
Sets the colors that should be used fore this DataSet.
|
void |
setDrawIcons(boolean enabled)
Set this to true to draw y-icons on the chart.
|
void |
setDrawValues(boolean enabled)
set this to true to draw y-values on the chart.
|
void |
setForm(Legend.LegendForm form) |
void |
setFormLineDashEffect(android.graphics.DashPathEffect dashPathEffect) |
void |
setFormLineWidth(float formLineWidth) |
void |
setFormSize(float formSize) |
void |
setGradientColor(int startColor,
int endColor)
Sets the start and end color for gradient color, ONLY color that should be used for this DataSet.
|
void |
setGradientColors(java.util.List<GradientColor> gradientColors)
Sets the start and end color for gradient colors, ONLY color that should be used for this DataSet.
|
void |
setHighlightEnabled(boolean enabled)
If set to true, value highlighting is enabled which means that values can
be highlighted programmatically or by touch gesture.
|
void |
setIconsOffset(MPPointF offsetDp)
Offset of icons drawn on the chart.
|
void |
setLabel(java.lang.String label)
###### ###### OTHER STYLING RELATED METHODS ##### ######
|
void |
setValueFormatter(ValueFormatter f)
Sets the formatter to be used for drawing the values inside the chart.
|
void |
setValueTextColor(int color)
Sets the color the value-labels of this DataSet should have.
|
void |
setValueTextColors(java.util.List<java.lang.Integer> colors)
Sets a list of colors to be used as the colors for the drawn values.
|
void |
setValueTextSize(float size)
Sets the text-size of the value-labels of this DataSet in dp.
|
void |
setValueTypeface(android.graphics.Typeface tf)
Sets a Typeface for the value-labels of this DataSet.
|
void |
setVisible(boolean visible)
Set the visibility of this DataSet.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEntry, addEntryOrdered, calcMinMax, calcMinMaxY, clear, getEntriesForXValue, getEntryCount, getEntryForIndex, getEntryForXValue, getEntryForXValue, getEntryIndex, getEntryIndex, getXMax, getXMin, getYMax, getYMin, removeEntryprotected java.util.List<java.lang.Integer> mColors
protected GradientColor mGradientColor
protected java.util.List<GradientColor> mGradientColors
protected java.util.List<java.lang.Integer> mValueColors
protected YAxis.AxisDependency mAxisDependency
protected boolean mHighlightEnabled
protected transient ValueFormatter mValueFormatter
protected android.graphics.Typeface mValueTypeface
protected boolean mDrawValues
protected boolean mDrawIcons
protected MPPointF mIconsOffset
protected float mValueTextSize
protected boolean mVisible
public BaseDataSet()
public BaseDataSet(java.lang.String label)
label - public void notifyDataSetChanged()
public java.util.List<java.lang.Integer> getColors()
public java.util.List<java.lang.Integer> getValueColors()
public int getColor()
IDataSetpublic int getColor(int index)
IDataSetpublic GradientColor getGradientColor()
IDataSetgetGradientColor in interface IDataSet<T extends Entry>public java.util.List<GradientColor> getGradientColors()
IDataSetgetGradientColors in interface IDataSet<T extends Entry>public GradientColor getGradientColor(int index)
IDataSetgetGradientColor in interface IDataSet<T extends Entry>public void setColors(java.util.List<java.lang.Integer> colors)
colors - public void setColors(int... colors)
colors - public void setColors(int[] colors,
android.content.Context c)
colors - public void addColor(int color)
color - public void setColor(int color)
color - public void setGradientColor(int startColor,
int endColor)
startColor - endColor - public void setGradientColors(java.util.List<GradientColor> gradientColors)
gradientColors - public void setColor(int color,
int alpha)
color - alpha - from 0-255public void setColors(int[] colors,
int alpha)
colors - alpha - public void resetColors()
public void setLabel(java.lang.String label)
public java.lang.String getLabel()
IDataSetpublic void setHighlightEnabled(boolean enabled)
IDataSetsetHighlightEnabled in interface IDataSet<T extends Entry>public boolean isHighlightEnabled()
IDataSetisHighlightEnabled in interface IDataSet<T extends Entry>public void setValueFormatter(ValueFormatter f)
IDataSetsetValueFormatter in interface IDataSet<T extends Entry>public ValueFormatter getValueFormatter()
IDataSetgetValueFormatter in interface IDataSet<T extends Entry>public boolean needsFormatter()
IDataSetneedsFormatter in interface IDataSet<T extends Entry>public void setValueTextColor(int color)
IDataSetsetValueTextColor in interface IDataSet<T extends Entry>public void setValueTextColors(java.util.List<java.lang.Integer> colors)
IDataSetsetValueTextColors in interface IDataSet<T extends Entry>public void setValueTypeface(android.graphics.Typeface tf)
IDataSetsetValueTypeface in interface IDataSet<T extends Entry>public void setValueTextSize(float size)
IDataSetsetValueTextSize in interface IDataSet<T extends Entry>public int getValueTextColor()
IDataSetgetValueTextColor in interface IDataSet<T extends Entry>public int getValueTextColor(int index)
IDataSetgetValueTextColor in interface IDataSet<T extends Entry>public android.graphics.Typeface getValueTypeface()
IDataSetgetValueTypeface in interface IDataSet<T extends Entry>public float getValueTextSize()
IDataSetgetValueTextSize in interface IDataSet<T extends Entry>public void setForm(Legend.LegendForm form)
public Legend.LegendForm getForm()
IDataSetpublic void setFormSize(float formSize)
public float getFormSize()
IDataSetgetFormSize in interface IDataSet<T extends Entry>public void setFormLineWidth(float formLineWidth)
public float getFormLineWidth()
IDataSetgetFormLineWidth in interface IDataSet<T extends Entry>public void setFormLineDashEffect(android.graphics.DashPathEffect dashPathEffect)
public android.graphics.DashPathEffect getFormLineDashEffect()
IDataSetgetFormLineDashEffect in interface IDataSet<T extends Entry>public void setDrawValues(boolean enabled)
IDataSetsetDrawValues in interface IDataSet<T extends Entry>public boolean isDrawValuesEnabled()
IDataSetisDrawValuesEnabled in interface IDataSet<T extends Entry>public void setDrawIcons(boolean enabled)
IDataSetsetDrawIcons in interface IDataSet<T extends Entry>public boolean isDrawIconsEnabled()
IDataSetisDrawIconsEnabled in interface IDataSet<T extends Entry>public void setIconsOffset(MPPointF offsetDp)
IDataSetsetIconsOffset in interface IDataSet<T extends Entry>public MPPointF getIconsOffset()
IDataSetgetIconsOffset in interface IDataSet<T extends Entry>public void setVisible(boolean visible)
IDataSetsetVisible in interface IDataSet<T extends Entry>public boolean isVisible()
IDataSetpublic YAxis.AxisDependency getAxisDependency()
IDataSetgetAxisDependency in interface IDataSet<T extends Entry>public void setAxisDependency(YAxis.AxisDependency dependency)
IDataSetsetAxisDependency in interface IDataSet<T extends Entry>public int getIndexInEntries(int xIndex)
getIndexInEntries in interface IDataSet<T extends Entry>public boolean removeFirst()
IDataSetremoveFirst in interface IDataSet<T extends Entry>public boolean removeLast()
IDataSetremoveLast in interface IDataSet<T extends Entry>public boolean removeEntryByXValue(float xValue)
IDataSetremoveEntryByXValue in interface IDataSet<T extends Entry>public boolean removeEntry(int index)
IDataSetremoveEntry in interface IDataSet<T extends Entry>public boolean contains(T e)
IDataSetprotected void copy(BaseDataSet baseDataSet)