Package 

Class PieChart

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewManager , android.view.ViewParent , android.view.accessibility.AccessibilityEventSource , com.github.mikephil.charting.interfaces.dataprovider.ChartInterface

    
    public class PieChart
    extends PieRadarChartBase<PieData>
                        

    View that represents a pie chart. Draws cake like slices.

    • Method Summary

      Modifier and Type Method Description
      void calculateOffsets() Calculates the offsets of the chart to the border depending on theposition of an eventual legend or depending on the length of the y-axisand x-axis labels and their position
      boolean needsHighlight(int index) Checks if the given index is set to be highlighted.
      XAxis getXAxis() This will throw an exception, PieChart has no XAxis object.
      int getIndexForAngle(float angle) Returns the xIndex for the given angle around the center of the chart.Returns -1 if not found / outofbounds.
      int getDataSetIndexForIndex(int xIndex) Returns the index of the DataSet this x-index belongs to.
      Array<float> getDrawAngles() returns an integer array of all the different angles the chart sliceshave the angles in the returned array determine how much space (of 360°)each slice takes
      Array<float> getAbsoluteAngles() returns the absolute angles of the different chart slices (where theslices end)
      void setHoleColor(int color) Sets the color for the hole that is drawn in the center of the PieChart(if enabled).
      void setDrawSlicesUnderHole(boolean enable) Enable or disable the visibility of the inner tips of the slices behind the hole
      boolean isDrawSlicesUnderHoleEnabled() Returns true if the inner tips of the slices are visible behind the hole,false if not.
      void setDrawHoleEnabled(boolean enabled) set this to true to draw the pie center empty
      boolean isDrawHoleEnabled() returns true if the hole in the center of the pie-chart is set to bevisible, false if not
      void setCenterText(CharSequence text) Sets the text String that is displayed in the center of the PieChart.
      CharSequence getCenterText() returns the text that is drawn in the center of the pie-chart
      void setDrawCenterText(boolean enabled) set this to true to draw the text that is displayed in the center of thepie chart
      boolean isDrawCenterTextEnabled() returns true if drawing the center text is enabled
      float getRadius() Returns the radius of the chart in pixels.
      RectF getCircleBox() returns the circlebox, the boundingbox of the pie-chart slices
      MPPointF getCenterCircleBox() returns the center of the circlebox
      void setCenterTextTypeface(Typeface t) sets the typeface for the center-text paint
      void setCenterTextSize(float sizeDp) Sets the size of the center text of the PieChart in dp.
      void setCenterTextSizePixels(float sizePixels) Sets the size of the center text of the PieChart in pixels.
      void setCenterTextOffset(float x, float y) Sets the offset the center text should have from it's original position in dp.
      MPPointF getCenterTextOffset() Returns the offset on the x- and y-axis the center text has in dp.
      void setCenterTextColor(int color) Sets the color of the center text of the PieChart.
      void setHoleRadius(float percent) sets the radius of the hole in the center of the piechart in percent ofthe maximum radius (max = the radius of the whole chart), default 50%
      float getHoleRadius() Returns the size of the hole radius in percent of the total radius.
      void setTransparentCircleColor(int color) Sets the color the transparent-circle should have.
      void setTransparentCircleRadius(float percent) sets the radius of the transparent circle that is drawn next to the holein the piechart in percent of the maximum radius (max = the radius of thewhole chart), default 55% -> means 5% larger than the center-hole bydefault
      float getTransparentCircleRadius()
      void setTransparentCircleAlpha(int alpha) Sets the amount of transparency the transparent circle should have 0 = fully transparent,255 = fully opaque.Default value is 100.
      void setDrawSliceText(boolean enabled) Set this to true to draw the entry labels into the pie slices (Provided by the getLabel() method of the PieEntry class).Deprecated -> use setDrawEntryLabels(...) instead.
      void setDrawEntryLabels(boolean enabled) Set this to true to draw the entry labels into the pie slices (Provided by the getLabel() method of the PieEntry class).
      boolean isDrawEntryLabelsEnabled() Returns true if drawing the entry labels is enabled, false if not.
      void setEntryLabelColor(int color) Sets the color the entry labels are drawn with.
      void setEntryLabelTypeface(Typeface tf) Sets a custom Typeface for the drawing of the entry labels.
      void setEntryLabelTextSize(float size) Sets the size of the entry labels in dp.
      void setDrawRoundedSlices(boolean enabled) Sets whether to draw slices in a curved fashion, only works if drawing the hole is enabledand if the slices are not drawn under the hole.
      boolean isDrawRoundedSlicesEnabled() Returns true if the chart is set to draw each end of a pie-slice"rounded".
      void setUsePercentValues(boolean enabled) If this is enabled, values inside the PieChart are drawn in percent andnot with their original value.
      boolean isUsePercentValuesEnabled() Returns true if using percentage values is enabled for the chart.
      void setCenterTextRadiusPercent(float percent) the rectangular radius of the bounding box for the center text, as a percentage of the pieholedefault 1.
      float getCenterTextRadiusPercent() the rectangular radius of the bounding box for the center text, as a percentage of the pieholedefault 1.
      float getMaxAngle()
      void setMaxAngle(float maxangle) Sets the max angle that is used for calculating the pie-circle.
      float getMinAngleForSlices() The minimum angle slices on the chart are rendered with, default is 0f.
      void setMinAngleForSlices(float minAngle) Set the angle to set minimum size for slices, you must call notifyDataSetChanged and invalidate when changing this, only works if there is enough room for allslices to have the minimum angle.
      String getAccessibilityDescription()
      • Methods inherited from class com.github.mikephil.charting.charts.PieRadarChartBase

        computeScroll, distanceToCenter, getAngleForPoint, getDiameter, getMaxVisibleCount, getMinOffset, getPosition, getPosition, getRawRotationAngle, getRotationAngle, getYChartMax, getYChartMin, isRotationEnabled, notifyDataSetChanged, onTouchEvent, setMinOffset, setRotationAngle, setRotationEnabled, spin
      • Methods inherited from class com.github.mikephil.charting.charts.Chart

        addViewportJob, animateX, animateX, animateXY, animateXY, animateXY, animateY, animateY, clear, clearAllViewportJobs, clearValues, disableScroll, dispatchPopulateAccessibilityEvent, enableScroll, getAccessibilitySummaryDescription, getAnimator, getCenter, getCenterOfView, getCenterOffsets, getChartBitmap, getContentRect, getData, getDefaultValueFormatter, getDescription, getDragDecelerationFrictionCoef, getExtraBottomOffset, getExtraLeftOffset, getExtraRightOffset, getExtraTopOffset, getHighlightByTouchPoint, getHighlighted, getHighlighter, getJobs, getLegend, getLegendRenderer, getMarker, getMarkerView, getMaxHighlightDistance, getOnChartGestureListener, getOnTouchListener, getPaint, getRenderer, getViewPortHandler, getXChartMax, getXChartMin, getXRange, getYMax, getYMin, highlightValue, highlightValue, highlightValue, highlightValue, highlightValue, highlightValue, highlightValue, highlightValue, highlightValue, highlightValue, highlightValues, isDragDecelerationEnabled, isDrawMarkerViewsEnabled, isDrawMarkersEnabled, isEmpty, isHighlightPerTapEnabled, isLogEnabled, removeViewportJob, saveToGallery, saveToGallery, saveToGallery, saveToPath, setAccessibilitySummaryDescription, setData, setDescription, setDragDecelerationEnabled, setDragDecelerationFrictionCoef, setDrawMarkerViews, setDrawMarkers, setExtraBottomOffset, setExtraLeftOffset, setExtraOffsets, setExtraRightOffset, setExtraTopOffset, setHardwareAccelerationEnabled, setHighlightPerTapEnabled, setHighlighter, setLogEnabled, setMarker, setMarkerView, setMaxHighlightDistance, setNoDataText, setNoDataTextAlignment, setNoDataTextColor, setNoDataTextTypeface, setOnChartGestureListener, setOnChartValueSelectedListener, setOnTouchListener, setPaint, setRenderer, setTouchEnabled, setUnbindEnabled, valuesToHighlight
      • Methods inherited from class android.view.ViewGroup

        addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findOnBackInvokedDispatcherForChild, findViewsWithText, focusSearch, focusableViewAvailable, gatherTransparentRegion, generateLayoutParams, getAccessibilityClassName, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onDescendantInvalidated, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setTouchscreenBlocksFocus, setTransitionGroup, setWindowInsetsAnimationCallback, shouldDelayChildPressedState, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout
      • Methods inherited from class android.view.View

        addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearPendingCredentialRequest, clearViewTranslationCallback, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findOnBackInvokedDispatcher, findViewById, findViewWithTag, forceHasOverlappingRendering, forceLayout, generateDisplayHash, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAllowedHandwritingDelegatePackageName, getAllowedHandwritingDelegatorPackageName, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContentSensitivity, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getFrameContentVelocity, getGlobalVisibleRect, getHandler, getHandwritingBoundsOffsetBottom, getHandwritingBoundsOffsetLeft, getHandwritingBoundsOffsetRight, getHandwritingBoundsOffsetTop, getHandwritingDelegateFlags, getHandwritingDelegatorCallback, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPendingCredentialCallback, getPendingCredentialRequest, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getRequestedFrameRate, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityDataSensitive, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isAutoHandwritingEnabled, isClickable, isContentSensitive, isContextClickable, isCredential, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHandwritingDelegate, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPreferKeepClear, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onRtlPropertiesChanged, onScreenStateChanged, onScrollCaptureSearch, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDataSensitive, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAllowedHandwritingDelegatePackage, setAllowedHandwritingDelegatorPackage, setAlpha, setAnimation, setAnimationMatrix, setAutoHandwritingEnabled, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContentSensitivity, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setFrameContentVelocity, setHandwritingBoundsOffsets, setHandwritingDelegateFlags, setHandwritingDelegatorCallback, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setIsCredential, setIsHandwritingDelegate, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPendingCredentialRequest, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, setPressed, setRenderEffect, setRequestedFrameRate, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
      • Methods inherited from class com.github.mikephil.charting.interfaces.dataprovider.ChartInterface

        getData, getHeight, getWidth
      • Methods inherited from class java.lang.Object

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

      • calculateOffsets

         void calculateOffsets()

        Calculates the offsets of the chart to the border depending on theposition of an eventual legend or depending on the length of the y-axisand x-axis labels and their position

      • needsHighlight

         boolean needsHighlight(int index)

        Checks if the given index is set to be highlighted.

      • getIndexForAngle

         int getIndexForAngle(float angle)

        Returns the xIndex for the given angle around the center of the chart.Returns -1 if not found / outofbounds.

      • getDataSetIndexForIndex

         int getDataSetIndexForIndex(int xIndex)

        Returns the index of the DataSet this x-index belongs to.

      • getDrawAngles

         Array<float> getDrawAngles()

        returns an integer array of all the different angles the chart sliceshave the angles in the returned array determine how much space (of 360°)each slice takes

      • getAbsoluteAngles

         Array<float> getAbsoluteAngles()

        returns the absolute angles of the different chart slices (where theslices end)

      • setHoleColor

         void setHoleColor(int color)

        Sets the color for the hole that is drawn in the center of the PieChart(if enabled).

      • setDrawSlicesUnderHole

         void setDrawSlicesUnderHole(boolean enable)

        Enable or disable the visibility of the inner tips of the slices behind the hole

      • isDrawSlicesUnderHoleEnabled

         boolean isDrawSlicesUnderHoleEnabled()

        Returns true if the inner tips of the slices are visible behind the hole,false if not.

      • setDrawHoleEnabled

         void setDrawHoleEnabled(boolean enabled)

        set this to true to draw the pie center empty

      • isDrawHoleEnabled

         boolean isDrawHoleEnabled()

        returns true if the hole in the center of the pie-chart is set to bevisible, false if not

      • setDrawCenterText

         void setDrawCenterText(boolean enabled)

        set this to true to draw the text that is displayed in the center of thepie chart

      • getRadius

         float getRadius()

        Returns the radius of the chart in pixels.

      • getCircleBox

         RectF getCircleBox()

        returns the circlebox, the boundingbox of the pie-chart slices

      • setCenterTextSize

         void setCenterTextSize(float sizeDp)

        Sets the size of the center text of the PieChart in dp.

      • setCenterTextSizePixels

         void setCenterTextSizePixels(float sizePixels)

        Sets the size of the center text of the PieChart in pixels.

      • setCenterTextOffset

         void setCenterTextOffset(float x, float y)

        Sets the offset the center text should have from it's original position in dp. Default x = 0, y = 0

      • setCenterTextColor

         void setCenterTextColor(int color)

        Sets the color of the center text of the PieChart.

      • setHoleRadius

         void setHoleRadius(float percent)

        sets the radius of the hole in the center of the piechart in percent ofthe maximum radius (max = the radius of the whole chart), default 50%

      • getHoleRadius

         float getHoleRadius()

        Returns the size of the hole radius in percent of the total radius.

      • setTransparentCircleRadius

         void setTransparentCircleRadius(float percent)

        sets the radius of the transparent circle that is drawn next to the holein the piechart in percent of the maximum radius (max = the radius of thewhole chart), default 55% -> means 5% larger than the center-hole bydefault

      • setTransparentCircleAlpha

         void setTransparentCircleAlpha(int alpha)

        Sets the amount of transparency the transparent circle should have 0 = fully transparent,255 = fully opaque.Default value is 100.

        Parameters:
        alpha - 0-255
      • setDrawSliceText

        @Deprecated() void setDrawSliceText(boolean enabled)

        Set this to true to draw the entry labels into the pie slices (Provided by the getLabel() method of the PieEntry class).Deprecated -> use setDrawEntryLabels(...) instead.

      • setDrawEntryLabels

         void setDrawEntryLabels(boolean enabled)

        Set this to true to draw the entry labels into the pie slices (Provided by the getLabel() method of the PieEntry class).

      • isDrawEntryLabelsEnabled

         boolean isDrawEntryLabelsEnabled()

        Returns true if drawing the entry labels is enabled, false if not.

      • setEntryLabelColor

         void setEntryLabelColor(int color)

        Sets the color the entry labels are drawn with.

      • setEntryLabelTextSize

         void setEntryLabelTextSize(float size)

        Sets the size of the entry labels in dp. Default: 13dp

      • setDrawRoundedSlices

         void setDrawRoundedSlices(boolean enabled)

        Sets whether to draw slices in a curved fashion, only works if drawing the hole is enabledand if the slices are not drawn under the hole.

        Parameters:
        enabled - draw curved ends of slices
      • isDrawRoundedSlicesEnabled

         boolean isDrawRoundedSlicesEnabled()

        Returns true if the chart is set to draw each end of a pie-slice"rounded".

      • setUsePercentValues

         void setUsePercentValues(boolean enabled)

        If this is enabled, values inside the PieChart are drawn in percent andnot with their original value. Values provided for the IValueFormatter toformat are then provided in percent.

      • isUsePercentValuesEnabled

         boolean isUsePercentValuesEnabled()

        Returns true if using percentage values is enabled for the chart.

      • setCenterTextRadiusPercent

         void setCenterTextRadiusPercent(float percent)

        the rectangular radius of the bounding box for the center text, as a percentage of the pieholedefault 1.f (100%)

      • getCenterTextRadiusPercent

         float getCenterTextRadiusPercent()

        the rectangular radius of the bounding box for the center text, as a percentage of the pieholedefault 1.f (100%)

      • setMaxAngle

         void setMaxAngle(float maxangle)

        Sets the max angle that is used for calculating the pie-circle. 360f meansit's a full PieChart, 180f results in a half-pie-chart. Default: 360f

        Parameters:
        maxangle - min 90, max 360
      • getMinAngleForSlices

         float getMinAngleForSlices()

        The minimum angle slices on the chart are rendered with, default is 0f.

      • setMinAngleForSlices

         void setMinAngleForSlices(float minAngle)

        Set the angle to set minimum size for slices, you must call notifyDataSetChanged and invalidate when changing this, only works if there is enough room for allslices to have the minimum angle.

        Parameters:
        minAngle - minimum 0, maximum is half of setMaxAngle