-
- 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.
-
-
Constructor Summary
Constructors Constructor Description BarLineChartBase(Context context, AttributeSet attrs, int defStyle)BarLineChartBase(Context context, AttributeSet attrs)BarLineChartBase(Context context)
-
Method Summary
Modifier and Type Method Description voidresetTracking()RESET PERFORMANCE TRACKING FIELDS voidnotifyDataSetChanged()Lets the chart know its underlying data has changed and performs allnecessary recalculations. voidcalculateOffsets()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 TransformergetTransformer(YAxis.AxisDependency which)Returns the Transformer class that contains all matrices and isresponsible for transforming values into pixels on the screen andbackwards. booleanonTouchEvent(MotionEvent event)voidcomputeScroll()voidzoomIn()Zooms in by 1.4f, into the charts center. voidzoomOut()Zooms out by 0.7f, from the charts center. voidresetZoom()Zooms out to original size. voidzoom(float scaleX, float scaleY, float x, float y)Zooms in or out by the given scale factor. voidzoom(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.. voidzoomToCenter(float scaleX, float scaleY)Zooms to the center of the chart with the given scale factor. voidzoomAndCenterAnimated(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. voidfitScreen()Resets all zooming and dragging and makes the chart fit exactly it'sbounds. voidsetScaleMinima(float scaleX, float scaleY)Sets the minimum scale factor value to which can be zoomed out. voidsetVisibleXRangeMaximum(float maxXRange)Sets the size of the area (range on the x-axis) that should be maximumvisible at once (no further zooming out allowed). voidsetVisibleXRangeMinimum(float minXRange)Sets the size of the area (range on the x-axis) that should be minimumvisible at once (no further zooming in allowed). voidsetVisibleXRange(float minXRange, float maxXRange)Limits the maximum and minimum x range that can be visible by pinching and zooming. voidsetVisibleYRangeMaximum(float maxYRange, YAxis.AxisDependency axis)Sets the size of the area (range on the y-axis) that should be maximumvisible at once. voidsetVisibleYRangeMinimum(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. voidsetVisibleYRange(float minYRange, float maxYRange, YAxis.AxisDependency axis)Limits the maximum and minimum y range that can be visible by pinching and zooming. voidmoveViewToX(float xValue)Moves the left side of the current viewport to the specified x-position.This also refreshes the chart by calling invalidate(). voidmoveViewTo(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(). voidmoveViewToAnimated(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(). voidcenterViewToY(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(). voidcenterViewTo(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(). voidcenterViewToAnimated(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. voidsetViewPortOffsets(float left, float top, float right, float bottom)Sets custom offsets for the current ViewPort (the offsets on the sides ofthe actual chart window). voidresetViewPortOffsets()Resets all custom offsets set via setViewPortOffsets(...) method. voidsetOnDrawListener(OnDrawListener drawListener)Sets the OnDrawListener OnDrawListenergetDrawListener()Gets the OnDrawListener. MPPointFgetPosition(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. voidsetMaxVisibleValueCount(int count)sets the number of maximum visible drawn values on the chart only activewhen setDrawValues() is enabled intgetMaxVisibleCount()voidsetHighlightPerDragEnabled(boolean enabled)Set this to true to allow highlighting per dragging over the chartsurface when it is fully zoomed out. booleanisHighlightPerDragEnabled()voidsetGridBackgroundColor(int color)Sets the color for the background of the chart-drawing area (everythingbehind the grid lines). voidsetDragEnabled(boolean enabled)Set this to true to enable dragging (moving the chart with the finger)for the chart (this does not effect scaling). booleanisDragEnabled()Returns true if dragging is enabled for the chart, false if not. voidsetDragXEnabled(boolean enabled)Set this to true to enable dragging on the X axis booleanisDragXEnabled()Returns true if dragging on the X axis is enabled for the chart, false if not. voidsetDragYEnabled(boolean enabled)Set this to true to enable dragging on the Y axis booleanisDragYEnabled()Returns true if dragging on the Y axis is enabled for the chart, false if not. voidsetScaleEnabled(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. voidsetScaleXEnabled(boolean enabled)voidsetScaleYEnabled(boolean enabled)booleanisScaleXEnabled()booleanisScaleYEnabled()voidsetFlingEnabled(boolean enabled)Set this to true to enable fling gesture for the chart booleanisFlingEnabled()Returns true if fling gesture is enabled for the chart, false if not. voidsetDoubleTapToZoomEnabled(boolean enabled)Set this to true to enable zooming in by double-tap on the chart. booleanisDoubleTapToZoomEnabled()Returns true if zooming via double-tap is enabled false if not. voidsetDrawGridBackground(boolean enabled)set this to true to draw the grid background, false if not voidsetDrawBorders(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. booleanisDrawBordersEnabled()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. voidsetClipValuesToContent(boolean enabled)When enabled, the values will be clipped to contentRect,otherwise they can bleed outside the content rect. voidsetClipDataToContent(boolean enabled)When disabled, the data and/or highlights will not be clipped to contentRect. booleanisClipValuesToContentEnabled()When enabled, the values will be clipped to contentRect,otherwise they can bleed outside the content rect. booleanisClipDataToContentEnabled()When disabled, the data and/or highlights will not be clipped to contentRect. voidsetBorderWidth(float width)Sets the width of the border lines in dp. voidsetBorderColor(int color)Sets the color of the chart border lines. floatgetMinOffset()Gets the minimum offset (padding) around the chart, defaults to 15. voidsetMinOffset(float minOffset)Sets the minimum offset (padding) around the chart, defaults to 15. booleanisKeepPositionOnRotation()Returns true if keeping the position on rotation is enabled and false if not. voidsetKeepPositionOnRotation(boolean keepPositionOnRotation)Sets whether the chart should keep its position (zoom / scroll) after a rotation (orientation change) MPPointDgetValuesByTouchPoint(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). voidgetValuesByTouchPoint(float x, float y, YAxis.AxisDependency axis, MPPointD outputPoint)MPPointDgetPixelForValues(float x, float y, YAxis.AxisDependency axis)Returns a recyclable MPPointD instanceTransforms the given chart values into pixels. EntrygetEntryByTouchPoint(float x, float y)returns the Entry object displayed at the touched position of the chart IBarLineScatterCandleBubbleDataSetgetDataSetByTouchPoint(float x, float y)returns the DataSet object displayed at the touched position of the chart floatgetLowestVisibleX()Returns the lowest x-index (value on the x-axis) that is still visible onthe chart. floatgetHighestVisibleX()Returns the highest x-index (value on the x-axis) that is still visibleon the chart. floatgetVisibleXRange()Returns the range visible on the x-axis. floatgetScaleX()returns the current x-scale factor floatgetScaleY()returns the current y-scale factor booleanisFullyZoomedOut()if the chart is fully zoomed out, return true YAxisgetAxisLeft()Returns the left y-axis object. YAxisgetAxisRight()Returns the right y-axis object. YAxisgetAxis(YAxis.AxisDependency axis)Returns the y-axis object to the corresponding AxisDependency. booleanisInverted(YAxis.AxisDependency axis)voidsetPinchZoom(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. booleanisPinchZoomEnabled()returns true if pinch-zoom is enabled, false if not voidsetDragOffsetX(float offset)Set an offset in dp that allows the user to drag the chart over it'sbounds on the x-axis. voidsetDragOffsetY(float offset)Set an offset in dp that allows the user to drag the chart over it'sbounds on the y-axis. booleanhasNoDragOffset()Returns true if both drag offsets (x and y) are zero or smaller. XAxisRenderergetRendererXAxis()voidsetXAxisRenderer(XAxisRenderer xAxisRenderer)Sets a custom XAxisRenderer and overrides the existing (default) one. YAxisRenderergetRendererLeftYAxis()voidsetRendererLeftYAxis(YAxisRenderer rendererLeftYAxis)Sets a custom axis renderer for the left axis and overwrites the existing one. YAxisRenderergetRendererRightYAxis()voidsetRendererRightYAxis(YAxisRenderer rendererRightYAxis)Sets a custom axis renderer for the right acis and overwrites the existing one. floatgetYChartMax()Returns the maximum y value of the chart, regardless of zoom or translation. floatgetYChartMin()Returns the minimum y value of the chart, regardless of zoom or translation. booleanisAnyAxisInverted()Returns true if either the left or the right or both axes are inverted. voidsetAutoScaleMinMaxEnabled(boolean enabled)Flag that indicates if auto scaling on the y axis is enabled. booleanisAutoScaleMinMaxEnabled()voidsetPaint(Paint p, int which)set a new paint object for the specified parameter in the chart e.g.Chart. PaintgetPaint(int which)Returns the paint object associated with the provided constant. voidsetTextColor(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
-
-
Constructor Detail
-
BarLineChartBase
BarLineChartBase(Context context, AttributeSet attrs, int defStyle)
-
BarLineChartBase
BarLineChartBase(Context context, AttributeSet attrs)
-
BarLineChartBase
BarLineChartBase(Context context)
-
-
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
-
getTransformer
Transformer getTransformer(YAxis.AxisDependency which)
Returns the Transformer class that contains all matrices and isresponsible for transforming values into pixels on the screen andbackwards.
-
onTouchEvent
boolean onTouchEvent(MotionEvent event)
-
computeScroll
void computeScroll()
-
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 inscaleY- 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-axisaxis- 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.
-
setOnDrawListener
void setOnDrawListener(OnDrawListener drawListener)
Sets the OnDrawListener
-
getDrawListener
OnDrawListener getDrawListener()
Gets the OnDrawListener. May be null.
-
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
-
getMaxVisibleCount
int getMaxVisibleCount()
-
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
-
isHighlightPerDragEnabled
boolean isHighlightPerDragEnabled()
-
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.
-
setScaleXEnabled
void setScaleXEnabled(boolean enabled)
-
setScaleYEnabled
void setScaleYEnabled(boolean enabled)
-
isScaleXEnabled
boolean isScaleXEnabled()
-
isScaleYEnabled
boolean isScaleYEnabled()
-
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(...).
-
getValuesByTouchPoint
void getValuesByTouchPoint(float x, float y, YAxis.AxisDependency axis, MPPointD outputPoint)
-
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
-
getDataSetByTouchPoint
IBarLineScatterCandleBubbleDataSet getDataSetByTouchPoint(float x, float y)
returns the DataSet 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
-
isInverted
boolean isInverted(YAxis.AxisDependency axis)
-
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.
-
getRendererXAxis
XAxisRenderer getRendererXAxis()
-
setXAxisRenderer
void setXAxisRenderer(XAxisRenderer xAxisRenderer)
Sets a custom XAxisRenderer and overrides the existing (default) one.
-
getRendererLeftYAxis
YAxisRenderer getRendererLeftYAxis()
-
setRendererLeftYAxis
void setRendererLeftYAxis(YAxisRenderer rendererLeftYAxis)
Sets a custom axis renderer for the left axis and overwrites the existing one.
-
getRendererRightYAxis
YAxisRenderer getRendererRightYAxis()
-
setRendererRightYAxis
void setRendererRightYAxis(YAxisRenderer rendererRightYAxis)
Sets a custom axis renderer for the right acis and overwrites the existing one.
-
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
-
isAutoScaleMinMaxEnabled
boolean isAutoScaleMinMaxEnabled()
-
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 objectwhich- 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.
-
-
-
-