-
- All Implemented Interfaces:
-
com.github.mikephil.charting.interfaces.datasets.IDataSet,com.github.mikephil.charting.interfaces.datasets.IDataSet,com.github.mikephil.charting.interfaces.datasets.IPieDataSet,java.io.Serializable
public class PieDataSet extends DataSet<PieEntry> implements IPieDataSet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumPieDataSet.ValuePosition
-
Constructor Summary
Constructors Constructor Description PieDataSet(List<PieEntry> yVals, String label)
-
Method Summary
Modifier and Type Method Description DataSet<PieEntry>copy()Provides an exact copy of the DataSet this method is used on. voidsetSliceSpace(float spaceDp)Sets the space that is left out between the piechart-slices in dp. floatgetSliceSpace()Returns the space that is set to be between the piechart-slices of thisDataSet, in pixels. voidsetAutomaticallyDisableSliceSpacing(boolean autoDisable)When enabled, slice spacing will be 0.0 when the smallest value is going to besmaller than the slice spacing itself. booleanisAutomaticallyDisableSliceSpacingEnabled()When enabled, slice spacing will be 0.0 when the smallest value is going to besmaller than the slice spacing itself. voidsetSelectionShift(float shift)sets the distance the highlighted piechart-slice of this DataSet is"shifted" away from the center of the chart, default 12f floatgetSelectionShift()Returns the distance a highlighted piechart slice is "shifted" away fromthe chart-center in dp. PieDataSet.ValuePositiongetXValuePosition()voidsetXValuePosition(PieDataSet.ValuePosition xValuePosition)PieDataSet.ValuePositiongetYValuePosition()voidsetYValuePosition(PieDataSet.ValuePosition yValuePosition)booleanisUsingSliceColorAsValueLineColor()This method is deprecated.Use isUseValueColorForLineEnabled() instead. voidsetUsingSliceColorAsValueLineColor(boolean enabled)This method is deprecated.Use setUseValueColorForLine(...) instead. intgetValueLineColor()When valuePosition is OutsideSlice, indicates line color voidsetValueLineColor(int valueLineColor)booleanisUseValueColorForLineEnabled()When valuePosition is OutsideSlice and enabled, line will have the same color as the slice voidsetUseValueColorForLine(boolean enabled)floatgetValueLineWidth()When valuePosition is OutsideSlice, indicates line width voidsetValueLineWidth(float valueLineWidth)floatgetValueLinePart1OffsetPercentage()When valuePosition is OutsideSlice, indicates offset as percentage out of the slice size voidsetValueLinePart1OffsetPercentage(float valueLinePart1OffsetPercentage)floatgetValueLinePart1Length()When valuePosition is OutsideSlice, indicates length of first half of the line voidsetValueLinePart1Length(float valueLinePart1Length)floatgetValueLinePart2Length()When valuePosition is OutsideSlice, indicates length of second half of the line voidsetValueLinePart2Length(float valueLinePart2Length)booleanisValueLineVariableLength()When valuePosition is OutsideSlice, this allows variable line length voidsetValueLineVariableLength(boolean valueLineVariableLength)IntegergetHighlightColor()Gets the color for the highlighted sector voidsetHighlightColor(@Nullable() Integer color)Sets the color for the highlighted sector (null for using entry color) -
Methods inherited from class com.github.mikephil.charting.data.DataSet
addEntry, addEntryOrdered, calcMinMax, calcMinMaxY, clear, copy, getEntries, getEntriesForXValue, getEntryCount, getEntryForIndex, getEntryForXValue, getEntryForXValue, getEntryIndex, getEntryIndex, getValues, getXMax, getXMin, getYMax, getYMin, removeEntry, setEntries, setValues, toSimpleString, toString -
Methods inherited from class com.github.mikephil.charting.data.BaseDataSet
addColor, contains, getAxisDependency, getColor, getColors, getForm, getFormLineDashEffect, getFormLineWidth, getFormSize, getIconsOffset, getIndexInEntries, getLabel, getValueColors, getValueFormatter, getValueTextColor, getValueTextSize, getValueTypeface, isDrawIconsEnabled, isDrawValuesEnabled, isHighlightEnabled, isVisible, needsFormatter, notifyDataSetChanged, removeEntry, removeEntryByXValue, removeFirst, removeLast, resetColors, setAxisDependency, setColor, setColors, setDrawIcons, setDrawValues, setForm, setFormLineDashEffect, setFormLineWidth, setFormSize, setHighlightEnabled, setIconsOffset, setLabel, setValueFormatter, setValueTextColor, setValueTextColors, setValueTextSize, setValueTypeface, setVisible -
Methods inherited from class com.github.mikephil.charting.interfaces.datasets.IDataSet
contains, getAxisDependency, getColor, getColor, getColors, getEntryForXValue, getEntryIndex, getEntryIndex, getForm, getFormLineDashEffect, getFormLineWidth, getFormSize, getIconsOffset, getIndexInEntries, getLabel, getValueFormatter, getValueTextColor, getValueTextColor, getValueTextSize, getValueTypeface, isDrawIconsEnabled, isDrawValuesEnabled, isHighlightEnabled, isVisible, needsFormatter, removeEntry, removeEntryByXValue, removeFirst, removeLast, setAxisDependency, setDrawIcons, setDrawValues, setHighlightEnabled, setIconsOffset, setLabel, setValueFormatter, setValueTextColor, setValueTextColors, setValueTextSize, setValueTypeface, setVisible -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setSliceSpace
void setSliceSpace(float spaceDp)
Sets the space that is left out between the piechart-slices in dp.Default: 0 --> no space, maximum 20f
-
getSliceSpace
float getSliceSpace()
Returns the space that is set to be between the piechart-slices of thisDataSet, in pixels.
-
setAutomaticallyDisableSliceSpacing
void setAutomaticallyDisableSliceSpacing(boolean autoDisable)
When enabled, slice spacing will be 0.0 when the smallest value is going to besmaller than the slice spacing itself.
-
isAutomaticallyDisableSliceSpacingEnabled
boolean isAutomaticallyDisableSliceSpacingEnabled()
When enabled, slice spacing will be 0.0 when the smallest value is going to besmaller than the slice spacing itself.
-
setSelectionShift
void setSelectionShift(float shift)
sets the distance the highlighted piechart-slice of this DataSet is"shifted" away from the center of the chart, default 12f
-
getSelectionShift
float getSelectionShift()
Returns the distance a highlighted piechart slice is "shifted" away fromthe chart-center in dp.
-
getXValuePosition
PieDataSet.ValuePosition getXValuePosition()
-
setXValuePosition
void setXValuePosition(PieDataSet.ValuePosition xValuePosition)
-
getYValuePosition
PieDataSet.ValuePosition getYValuePosition()
-
setYValuePosition
void setYValuePosition(PieDataSet.ValuePosition yValuePosition)
-
isUsingSliceColorAsValueLineColor
@Deprecated() boolean isUsingSliceColorAsValueLineColor()
This method is deprecated.Use isUseValueColorForLineEnabled() instead.
-
setUsingSliceColorAsValueLineColor
@Deprecated() void setUsingSliceColorAsValueLineColor(boolean enabled)
This method is deprecated.Use setUseValueColorForLine(...) instead.
-
getValueLineColor
int getValueLineColor()
When valuePosition is OutsideSlice, indicates line color
-
setValueLineColor
void setValueLineColor(int valueLineColor)
-
isUseValueColorForLineEnabled
boolean isUseValueColorForLineEnabled()
When valuePosition is OutsideSlice and enabled, line will have the same color as the slice
-
setUseValueColorForLine
void setUseValueColorForLine(boolean enabled)
-
getValueLineWidth
float getValueLineWidth()
When valuePosition is OutsideSlice, indicates line width
-
setValueLineWidth
void setValueLineWidth(float valueLineWidth)
-
getValueLinePart1OffsetPercentage
float getValueLinePart1OffsetPercentage()
When valuePosition is OutsideSlice, indicates offset as percentage out of the slice size
-
setValueLinePart1OffsetPercentage
void setValueLinePart1OffsetPercentage(float valueLinePart1OffsetPercentage)
-
getValueLinePart1Length
float getValueLinePart1Length()
When valuePosition is OutsideSlice, indicates length of first half of the line
-
setValueLinePart1Length
void setValueLinePart1Length(float valueLinePart1Length)
-
getValueLinePart2Length
float getValueLinePart2Length()
When valuePosition is OutsideSlice, indicates length of second half of the line
-
setValueLinePart2Length
void setValueLinePart2Length(float valueLinePart2Length)
-
isValueLineVariableLength
boolean isValueLineVariableLength()
When valuePosition is OutsideSlice, this allows variable line length
-
setValueLineVariableLength
void setValueLineVariableLength(boolean valueLineVariableLength)
-
getHighlightColor
@Nullable() Integer getHighlightColor()
Gets the color for the highlighted sector
-
setHighlightColor
void setHighlightColor(@Nullable() Integer color)
Sets the color for the highlighted sector (null for using entry color)
-
-
-
-