Package 

Class BarLineChartBase

  • 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.BarLineScatterCandleBubbleDataProvider , com.github.mikephil.charting.interfaces.dataprovider.ChartInterface

    
    public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData<out IBarLineScatterCandleBubbleDataSet<out Entry>>>
    extends Chart<T> implements BarLineScatterCandleBubbleDataProvider
                        

    Base-class of LineChart, BarChart, ScatterChart and CandleStickChart.

    • Method Summary

      Modifier and Type Method Description
      void resetTracking() RESET PERFORMANCE TRACKING FIELDS
      void notifyDataSetChanged() Lets the chart know its underlying data has changed and performs allnecessary recalculations.
      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
      Transformer getTransformer(YAxis.AxisDependency which) Returns the Transformer class that contains all matrices and isresponsible for transforming values into pixels on the screen andbackwards.
      boolean onTouchEvent(MotionEvent event)
      void computeScroll()
      void zoomIn() Zooms in by 1.4f, into the charts center.
      void zoomOut() Zooms out by 0.7f, from the charts center.
      void resetZoom() Zooms out to original size.
      void zoom(float scaleX, float scaleY, float x, float y) Zooms in or out by the given scale factor.
      void zoom(float scaleX, float scaleY, float xValue, float yValue, YAxis.AxisDependency axis) Zooms in or out by the given scale factor.x and y are the values (NOT PIXELS) of the zoom center..
      void zoomToCenter(float scaleX, float scaleY) Zooms to the center of the chart with the given scale factor.
      void zoomAndCenterAnimated(float scaleX, float scaleY, float xValue, float yValue, YAxis.AxisDependency axis, long duration) Zooms by the specified scale factor to the specified values on the specified axis.
      void fitScreen() Resets all zooming and dragging and makes the chart fit exactly it'sbounds.
      void setScaleMinima(float scaleX, float scaleY) Sets the minimum scale factor value to which can be zoomed out.
      void setVisibleXRangeMaximum(float maxXRange) Sets the size of the area (range on the x-axis) that should be maximumvisible at once (no further zooming out allowed).
      void setVisibleXRangeMinimum(float minXRange) Sets the size of the area (range on the x-axis) that should be minimumvisible at once (no further zooming in allowed).
      void setVisibleXRange(float minXRange, float maxXRange) Limits the maximum and minimum x range that can be visible by pinching and zooming.
      void setVisibleYRangeMaximum(float maxYRange, YAxis.AxisDependency axis) Sets the size of the area (range on the y-axis) that should be maximumvisible at once.
      void setVisibleYRangeMinimum(float minYRange, YAxis.AxisDependency axis) Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible.
      void setVisibleYRange(float minYRange, float maxYRange, YAxis.AxisDependency axis) Limits the maximum and minimum y range that can be visible by pinching and zooming.
      void moveViewToX(float xValue) Moves the left side of the current viewport to the specified x-position.This also refreshes the chart by calling invalidate().
      void moveViewTo(float xValue, float yValue, YAxis.AxisDependency axis) This will move the left side of the current viewport to the specifiedx-value on the x-axis, and center the viewport to the specified y value on the y-axis.This also refreshes the chart by calling invalidate().
      void moveViewToAnimated(float xValue, float yValue, YAxis.AxisDependency axis, long duration) This will move the left side of the current viewport to the specified x-valueand center the viewport to the y value animated.This also refreshes the chart by calling invalidate().
      void centerViewToY(float yValue, YAxis.AxisDependency axis) Centers the viewport to the specified y value on the y-axis.This also refreshes the chart by calling invalidate().
      void centerViewTo(float xValue, float yValue, YAxis.AxisDependency axis) This will move the center of the current viewport to the specifiedx and y value.This also refreshes the chart by calling invalidate().
      void centerViewToAnimated(float xValue, float yValue, YAxis.AxisDependency axis, long duration) This will move the center of the current viewport to the specifiedx and y value animated.
      void setViewPortOffsets(float left, float top, float right, float bottom) Sets custom offsets for the current ViewPort (the offsets on the sides ofthe actual chart window).
      void resetViewPortOffsets() Resets all custom offsets set via setViewPortOffsets(...) method.
      void setOnDrawListener(OnDrawListener drawListener) Sets the OnDrawListener
      OnDrawListener getDrawListener() Gets the OnDrawListener.
      MPPointF getPosition(Entry e, YAxis.AxisDependency axis) Returns a recyclable MPPointF instance.Returns the position (in pixels) the provided Entry has inside the chartview or null, if the provided Entry is null.
      void setMaxVisibleValueCount(int count) sets the number of maximum visible drawn values on the chart only activewhen setDrawValues() is enabled
      int getMaxVisibleCount()
      void setHighlightPerDragEnabled(boolean enabled) Set this to true to allow highlighting per dragging over the chartsurface when it is fully zoomed out.
      boolean isHighlightPerDragEnabled()
      void setGridBackgroundColor(int color) Sets the color for the background of the chart-drawing area (everythingbehind the grid lines).
      void setDragEnabled(boolean enabled) Set this to true to enable dragging (moving the chart with the finger)for the chart (this does not effect scaling).
      boolean isDragEnabled() Returns true if dragging is enabled for the chart, false if not.
      void setDragXEnabled(boolean enabled) Set this to true to enable dragging on the X axis
      boolean isDragXEnabled() Returns true if dragging on the X axis is enabled for the chart, false if not.
      void setDragYEnabled(boolean enabled) Set this to true to enable dragging on the Y axis
      boolean isDragYEnabled() Returns true if dragging on the Y axis is enabled for the chart, false if not.
      void setScaleEnabled(boolean enabled) Set this to true to enable scaling (zooming in and out by gesture) forthe chart (this does not effect dragging) on both X- and Y-Axis.
      void setScaleXEnabled(boolean enabled)
      void setScaleYEnabled(boolean enabled)
      boolean isScaleXEnabled()
      boolean isScaleYEnabled()
      void setFlingEnabled(boolean enabled) Set this to true to enable fling gesture for the chart
      boolean isFlingEnabled() Returns true if fling gesture is enabled for the chart, false if not.
      void setDoubleTapToZoomEnabled(boolean enabled) Set this to true to enable zooming in by double-tap on the chart.
      boolean isDoubleTapToZoomEnabled() Returns true if zooming via double-tap is enabled false if not.
      void setDrawGridBackground(boolean enabled) set this to true to draw the grid background, false if not
      void setDrawBorders(boolean enabled) When enabled, the borders rectangle will be rendered.If this is enabled, there is no point drawing the axis-lines of x- and y-axis.
      boolean isDrawBordersEnabled() When enabled, the borders rectangle will be rendered.If this is enabled, there is no point drawing the axis-lines of x- and y-axis.
      void setClipValuesToContent(boolean enabled) When enabled, the values will be clipped to contentRect,otherwise they can bleed outside the content rect.
      void setClipDataToContent(boolean enabled) When disabled, the data and/or highlights will not be clipped to contentRect.
      boolean isClipValuesToContentEnabled() When enabled, the values will be clipped to contentRect,otherwise they can bleed outside the content rect.
      boolean isClipDataToContentEnabled() When disabled, the data and/or highlights will not be clipped to contentRect.
      void setBorderWidth(float width) Sets the width of the border lines in dp.
      void setBorderColor(int color) Sets the color of the chart border lines.
      float getMinOffset() Gets the minimum offset (padding) around the chart, defaults to 15.
      void setMinOffset(float minOffset) Sets the minimum offset (padding) around the chart, defaults to 15.
      boolean isKeepPositionOnRotation() Returns true if keeping the position on rotation is enabled and false if not.
      void setKeepPositionOnRotation(boolean keepPositionOnRotation) Sets whether the chart should keep its position (zoom / scroll) after a rotation (orientation change)
      MPPointD getValuesByTouchPoint(float x, float y, YAxis.AxisDependency axis) Returns a recyclable MPPointD instanceReturns the x and y values in the chart at the given touch point(encapsulated in a MPPointD).
      void getValuesByTouchPoint(float x, float y, YAxis.AxisDependency axis, MPPointD outputPoint)
      MPPointD getPixelForValues(float x, float y, YAxis.AxisDependency axis) Returns a recyclable MPPointD instanceTransforms the given chart values into pixels.
      Entry getEntryByTouchPoint(float x, float y) returns the Entry object displayed at the touched position of the chart
      IBarLineScatterCandleBubbleDataSet getDataSetByTouchPoint(float x, float y) returns the DataSet object displayed at the touched position of the chart
      float getLowestVisibleX() Returns the lowest x-index (value on the x-axis) that is still visible onthe chart.
      float getHighestVisibleX() Returns the highest x-index (value on the x-axis) that is still visibleon the chart.
      float getVisibleXRange() Returns the range visible on the x-axis.
      float getScaleX() returns the current x-scale factor
      float getScaleY() returns the current y-scale factor
      boolean isFullyZoomedOut() if the chart is fully zoomed out, return true
      YAxis getAxisLeft() Returns the left y-axis object.
      YAxis getAxisRight() Returns the right y-axis object.
      YAxis getAxis(YAxis.AxisDependency axis) Returns the y-axis object to the corresponding AxisDependency.
      boolean isInverted(YAxis.AxisDependency axis)
      void setPinchZoom(boolean enabled) If set to true, both x and y axis can be scaled simultaneously with 2 fingers, if false,x and y axis can be scaled separately.
      boolean isPinchZoomEnabled() returns true if pinch-zoom is enabled, false if not
      void setDragOffsetX(float offset) Set an offset in dp that allows the user to drag the chart over it'sbounds on the x-axis.
      void setDragOffsetY(float offset) Set an offset in dp that allows the user to drag the chart over it'sbounds on the y-axis.
      boolean hasNoDragOffset() Returns true if both drag offsets (x and y) are zero or smaller.
      XAxisRenderer getRendererXAxis()
      void setXAxisRenderer(XAxisRenderer xAxisRenderer) Sets a custom XAxisRenderer and overrides the existing (default) one.
      YAxisRenderer getRendererLeftYAxis()
      void setRendererLeftYAxis(YAxisRenderer rendererLeftYAxis) Sets a custom axis renderer for the left axis and overwrites the existing one.
      YAxisRenderer getRendererRightYAxis()
      void setRendererRightYAxis(YAxisRenderer rendererRightYAxis) Sets a custom axis renderer for the right acis and overwrites the existing one.
      float getYChartMax() Returns the maximum y value of the chart, regardless of zoom or translation.
      float getYChartMin() Returns the minimum y value of the chart, regardless of zoom or translation.
      boolean isAnyAxisInverted() Returns true if either the left or the right or both axes are inverted.
      void setAutoScaleMinMaxEnabled(boolean enabled) Flag that indicates if auto scaling on the y axis is enabled.
      boolean isAutoScaleMinMaxEnabled()
      void setPaint(Paint p, int which) set a new paint object for the specified parameter in the chart e.g.Chart.
      Paint getPaint(int which) Returns the paint object associated with the provided constant.
      void setTextColor(int color) Sets the text color to use for the labels.
      • Methods inherited from class com.github.mikephil.charting.charts.Chart

        addViewportJob, animateX, animateX, animateXY, animateXY, animateXY, animateY, animateY, clear, clearAllViewportJobs, clearValues, disableScroll, dispatchPopulateAccessibilityEvent, enableScroll, getAccessibilityDescription, 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, getRenderer, getViewPortHandler, getXAxis, 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, 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 com.github.mikephil.charting.interfaces.dataprovider.BarLineScatterCandleBubbleDataProvider

        getData, getHighestVisibleX, getLowestVisibleX, getTransformer, isInverted
      • Methods inherited from class java.lang.Object

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

      • resetTracking

         void resetTracking()

        RESET PERFORMANCE TRACKING FIELDS

      • notifyDataSetChanged

         void notifyDataSetChanged()

        Lets the chart know its underlying data has changed and performs allnecessary recalculations. It is crucial that this method is calledeverytime data is changed dynamically. Not calling this method can leadto crashes or unexpected behaviour.

      • 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

      • zoomIn

         void zoomIn()

        Zooms in by 1.4f, into the charts center.

      • zoomOut

         void zoomOut()

        Zooms out by 0.7f, from the charts center.

      • resetZoom

         void resetZoom()

        Zooms out to original size.

      • zoom

         void zoom(float scaleX, float scaleY, float x, float y)

        Zooms in or out by the given scale factor. x and y are the coordinates(in pixels) of the zoom center.

        Parameters:
        scaleX - if < 1f --> zoom out, if > 1f --> zoom in
        scaleY - if < 1f --> zoom out, if > 1f --> zoom in
      • zoom

         void zoom(float scaleX, float scaleY, float xValue, float yValue, YAxis.AxisDependency axis)

        Zooms in or out by the given scale factor.x and y are the values (NOT PIXELS) of the zoom center..

        Parameters:
        axis - the axis relative to which the zoom should take place
      • zoomToCenter

         void zoomToCenter(float scaleX, float scaleY)

        Zooms to the center of the chart with the given scale factor.

      • zoomAndCenterAnimated

         void zoomAndCenterAnimated(float scaleX, float scaleY, float xValue, float yValue, YAxis.AxisDependency axis, long duration)

        Zooms by the specified scale factor to the specified values on the specified axis.

      • fitScreen

         void fitScreen()

        Resets all zooming and dragging and makes the chart fit exactly it'sbounds.

      • setScaleMinima

         void setScaleMinima(float scaleX, float scaleY)

        Sets the minimum scale factor value to which can be zoomed out. 1f =fitScreen

      • setVisibleXRangeMaximum

         void setVisibleXRangeMaximum(float maxXRange)

        Sets the size of the area (range on the x-axis) that should be maximumvisible at once (no further zooming out allowed). If this is e.g. set to10, no more than a range of 10 on the x-axis can be viewed at once withoutscrolling.

        Parameters:
        maxXRange - The maximum visible range of x-values.
      • setVisibleXRangeMinimum

         void setVisibleXRangeMinimum(float minXRange)

        Sets the size of the area (range on the x-axis) that should be minimumvisible at once (no further zooming in allowed). If this is e.g. set to10, no less than a range of 10 on the x-axis can be viewed at once withoutscrolling.

        Parameters:
        minXRange - The minimum visible range of x-values.
      • setVisibleXRange

         void setVisibleXRange(float minXRange, float maxXRange)

        Limits the maximum and minimum x range that can be visible by pinching and zooming. e.g. minRange=10, maxRange=100 thesmallest range to be displayed at once is 10, and no more than a range of 100 values can be viewed at once withoutscrolling

      • setVisibleYRangeMaximum

         void setVisibleYRangeMaximum(float maxYRange, YAxis.AxisDependency axis)

        Sets the size of the area (range on the y-axis) that should be maximumvisible at once.

        Parameters:
        maxYRange - the maximum visible range on the y-axis
        axis - the axis for which this limit should apply
      • setVisibleYRangeMinimum

         void setVisibleYRangeMinimum(float minYRange, YAxis.AxisDependency axis)

        Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible.

        Parameters:
        axis - the axis for which this limit should apply
      • setVisibleYRange

         void setVisibleYRange(float minYRange, float maxYRange, YAxis.AxisDependency axis)

        Limits the maximum and minimum y range that can be visible by pinching and zooming.

      • moveViewToX

         void moveViewToX(float xValue)

        Moves the left side of the current viewport to the specified x-position.This also refreshes the chart by calling invalidate().

      • moveViewTo

         void moveViewTo(float xValue, float yValue, YAxis.AxisDependency axis)

        This will move the left side of the current viewport to the specifiedx-value on the x-axis, and center the viewport to the specified y value on the y-axis.This also refreshes the chart by calling invalidate().

        Parameters:
        axis - - which axis should be used as a reference for the y-axis
      • moveViewToAnimated

         void moveViewToAnimated(float xValue, float yValue, YAxis.AxisDependency axis, long duration)

        This will move the left side of the current viewport to the specified x-valueand center the viewport to the y value animated.This also refreshes the chart by calling invalidate().

        Parameters:
        duration - the duration of the animation in milliseconds
      • centerViewToY

         void centerViewToY(float yValue, YAxis.AxisDependency axis)

        Centers the viewport to the specified y value on the y-axis.This also refreshes the chart by calling invalidate().

        Parameters:
        axis - - which axis should be used as a reference for the y-axis
      • centerViewTo

         void centerViewTo(float xValue, float yValue, YAxis.AxisDependency axis)

        This will move the center of the current viewport to the specifiedx and y value.This also refreshes the chart by calling invalidate().

        Parameters:
        axis - - which axis should be used as a reference for the y axis
      • centerViewToAnimated

         void centerViewToAnimated(float xValue, float yValue, YAxis.AxisDependency axis, long duration)

        This will move the center of the current viewport to the specifiedx and y value animated.

        Parameters:
        duration - the duration of the animation in milliseconds
      • setViewPortOffsets

         void setViewPortOffsets(float left, float top, float right, float bottom)

        Sets custom offsets for the current ViewPort (the offsets on the sides ofthe actual chart window). Setting this will prevent the chart fromautomatically calculating it's offsets. Use resetViewPortOffsets() toundo this. ONLY USE THIS WHEN YOU KNOW WHAT YOU ARE DOING, else usesetExtraOffsets(...).

      • resetViewPortOffsets

         void resetViewPortOffsets()

        Resets all custom offsets set via setViewPortOffsets(...) method. Allowsthe chart to again calculate all offsets automatically.

      • getPosition

         MPPointF getPosition(Entry e, YAxis.AxisDependency axis)

        Returns a recyclable MPPointF instance.Returns the position (in pixels) the provided Entry has inside the chartview or null, if the provided Entry is null.

      • setMaxVisibleValueCount

         void setMaxVisibleValueCount(int count)

        sets the number of maximum visible drawn values on the chart only activewhen setDrawValues() is enabled

      • setHighlightPerDragEnabled

         void setHighlightPerDragEnabled(boolean enabled)

        Set this to true to allow highlighting per dragging over the chartsurface when it is fully zoomed out. Default: true

      • setGridBackgroundColor

         void setGridBackgroundColor(int color)

        Sets the color for the background of the chart-drawing area (everythingbehind the grid lines).

      • setDragEnabled

         void setDragEnabled(boolean enabled)

        Set this to true to enable dragging (moving the chart with the finger)for the chart (this does not effect scaling).

      • isDragEnabled

         boolean isDragEnabled()

        Returns true if dragging is enabled for the chart, false if not.

      • setDragXEnabled

         void setDragXEnabled(boolean enabled)

        Set this to true to enable dragging on the X axis

      • isDragXEnabled

         boolean isDragXEnabled()

        Returns true if dragging on the X axis is enabled for the chart, false if not.

      • setDragYEnabled

         void setDragYEnabled(boolean enabled)

        Set this to true to enable dragging on the Y axis

      • isDragYEnabled

         boolean isDragYEnabled()

        Returns true if dragging on the Y axis is enabled for the chart, false if not.

      • setScaleEnabled

         void setScaleEnabled(boolean enabled)

        Set this to true to enable scaling (zooming in and out by gesture) forthe chart (this does not effect dragging) on both X- and Y-Axis.

      • setFlingEnabled

         void setFlingEnabled(boolean enabled)

        Set this to true to enable fling gesture for the chart

      • isFlingEnabled

         boolean isFlingEnabled()

        Returns true if fling gesture is enabled for the chart, false if not.

      • setDoubleTapToZoomEnabled

         void setDoubleTapToZoomEnabled(boolean enabled)

        Set this to true to enable zooming in by double-tap on the chart.Default: enabled

      • isDoubleTapToZoomEnabled

         boolean isDoubleTapToZoomEnabled()

        Returns true if zooming via double-tap is enabled false if not.

      • setDrawGridBackground

         void setDrawGridBackground(boolean enabled)

        set this to true to draw the grid background, false if not

      • setDrawBorders

         void setDrawBorders(boolean enabled)

        When enabled, the borders rectangle will be rendered.If this is enabled, there is no point drawing the axis-lines of x- and y-axis.

      • isDrawBordersEnabled

         boolean isDrawBordersEnabled()

        When enabled, the borders rectangle will be rendered.If this is enabled, there is no point drawing the axis-lines of x- and y-axis.

      • setClipValuesToContent

         void setClipValuesToContent(boolean enabled)

        When enabled, the values will be clipped to contentRect,otherwise they can bleed outside the content rect.

      • setClipDataToContent

         void setClipDataToContent(boolean enabled)

        When disabled, the data and/or highlights will not be clipped to contentRect. Disabling this option canbe useful, when the data lies fully within the content rect, but is drawn in such a way (such as thick lines)that there is unwanted clipping.

      • isClipValuesToContentEnabled

         boolean isClipValuesToContentEnabled()

        When enabled, the values will be clipped to contentRect,otherwise they can bleed outside the content rect.

      • isClipDataToContentEnabled

         boolean isClipDataToContentEnabled()

        When disabled, the data and/or highlights will not be clipped to contentRect. Disabling this option canbe useful, when the data lies fully within the content rect, but is drawn in such a way (such as thick lines)that there is unwanted clipping.

      • setBorderWidth

         void setBorderWidth(float width)

        Sets the width of the border lines in dp.

      • setBorderColor

         void setBorderColor(int color)

        Sets the color of the chart border lines.

      • getMinOffset

         float getMinOffset()

        Gets the minimum offset (padding) around the chart, defaults to 15.f

      • setMinOffset

         void setMinOffset(float minOffset)

        Sets the minimum offset (padding) around the chart, defaults to 15.f

      • isKeepPositionOnRotation

         boolean isKeepPositionOnRotation()

        Returns true if keeping the position on rotation is enabled and false if not.

      • setKeepPositionOnRotation

         void setKeepPositionOnRotation(boolean keepPositionOnRotation)

        Sets whether the chart should keep its position (zoom / scroll) after a rotation (orientation change)

      • getValuesByTouchPoint

         MPPointD getValuesByTouchPoint(float x, float y, YAxis.AxisDependency axis)

        Returns a recyclable MPPointD instanceReturns the x and y values in the chart at the given touch point(encapsulated in a MPPointD). This method transforms pixel coordinates tocoordinates / values in the chart. This is the opposite method togetPixelForValues(...).

      • getPixelForValues

         MPPointD getPixelForValues(float x, float y, YAxis.AxisDependency axis)

        Returns a recyclable MPPointD instanceTransforms the given chart values into pixels. This is the oppositemethod to getValuesByTouchPoint(...).

      • getEntryByTouchPoint

         Entry getEntryByTouchPoint(float x, float y)

        returns the Entry object displayed at the touched position of the chart

      • getLowestVisibleX

         float getLowestVisibleX()

        Returns the lowest x-index (value on the x-axis) that is still visible onthe chart.

      • getHighestVisibleX

         float getHighestVisibleX()

        Returns the highest x-index (value on the x-axis) that is still visibleon the chart.

      • getVisibleXRange

         float getVisibleXRange()

        Returns the range visible on the x-axis.

      • getScaleX

         float getScaleX()

        returns the current x-scale factor

      • getScaleY

         float getScaleY()

        returns the current y-scale factor

      • isFullyZoomedOut

         boolean isFullyZoomedOut()

        if the chart is fully zoomed out, return true

      • getAxisLeft

         YAxis getAxisLeft()

        Returns the left y-axis object. In the horizontal bar-chart, this is thetop axis.

      • getAxisRight

         YAxis getAxisRight()

        Returns the right y-axis object. In the horizontal bar-chart, this is thebottom axis.

      • getAxis

         YAxis getAxis(YAxis.AxisDependency axis)

        Returns the y-axis object to the corresponding AxisDependency. In thehorizontal bar-chart, LEFT == top, RIGHT == BOTTOM

      • setPinchZoom

         void setPinchZoom(boolean enabled)

        If set to true, both x and y axis can be scaled simultaneously with 2 fingers, if false,x and y axis can be scaled separately. default: false

      • isPinchZoomEnabled

         boolean isPinchZoomEnabled()

        returns true if pinch-zoom is enabled, false if not

      • setDragOffsetX

         void setDragOffsetX(float offset)

        Set an offset in dp that allows the user to drag the chart over it'sbounds on the x-axis.

      • setDragOffsetY

         void setDragOffsetY(float offset)

        Set an offset in dp that allows the user to drag the chart over it'sbounds on the y-axis.

      • hasNoDragOffset

         boolean hasNoDragOffset()

        Returns true if both drag offsets (x and y) are zero or smaller.

      • getYChartMax

         float getYChartMax()

        Returns the maximum y value of the chart, regardless of zoom or translation.

      • getYChartMin

         float getYChartMin()

        Returns the minimum y value of the chart, regardless of zoom or translation.

      • isAnyAxisInverted

         boolean isAnyAxisInverted()

        Returns true if either the left or the right or both axes are inverted.

      • setAutoScaleMinMaxEnabled

         void setAutoScaleMinMaxEnabled(boolean enabled)

        Flag that indicates if auto scaling on the y axis is enabled. This isespecially interesting for charts displaying financial data.

        Parameters:
        enabled - the y axis automatically adjusts to the min and max yvalues of the current x axis range whenever the viewportchanges
      • setPaint

         void setPaint(Paint p, int which)

        set a new paint object for the specified parameter in the chart e.g.Chart.PAINT_VALUES

        Parameters:
        p - the new paint object
        which - Chart.PAINT_VALUES, Chart.PAINT_GRID, Chart.PAINT_VALUES,...
      • getPaint

         Paint getPaint(int which)

        Returns the paint object associated with the provided constant.

        Parameters:
        which - e.g.
      • setTextColor

         void setTextColor(int color)

        Sets the text color to use for the labels. Make sure to usegetResources().getColor(...) when using a color from the resources.