public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Entry>>> extends android.view.ViewGroup implements ChartInterface
android.view.ViewGroup.LayoutParams, android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListenerandroid.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener, android.view.View.OnUnhandledKeyEventListener| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LOG_TAG |
protected ChartAnimator |
mAnimator
object responsible for animations
|
protected ChartTouchListener |
mChartTouchListener |
protected T |
mData
object that holds all data that was originally set for the chart, before
it was modified or any filtering algorithms had been applied
|
protected DefaultValueFormatter |
mDefaultValueFormatter
default value-formatter, number of digits depends on provided chart-data
|
protected android.graphics.Paint |
mDescPaint
paint object used for drawing the description text in the bottom right
corner of the chart
|
protected Description |
mDescription
the object responsible for representing the description text
|
protected boolean |
mDrawMarkers
if set to true, the marker view is drawn when a value is clicked
|
protected IHighlighter |
mHighlighter |
protected boolean |
mHighLightPerTapEnabled
Flag that indicates if highlighting per tap (touch) is enabled
|
protected Highlight[] |
mIndicesToHighlight
array of Highlight objects that reference the highlighted slices in the
chart
|
protected android.graphics.Paint |
mInfoPaint
paint object for drawing the information text when there are no values in
the chart
|
protected java.util.ArrayList<java.lang.Runnable> |
mJobs
tasks to be done after the view is setup
|
protected Legend |
mLegend
the legend object containing all data associated with the legend
|
protected LegendRenderer |
mLegendRenderer |
protected boolean |
mLogEnabled
flag that indicates if logging is enabled or not
|
protected IMarker |
mMarker
the view that represents the marker
|
protected float |
mMaxHighlightDistance
The maximum distance in dp away from an entry causing it to highlight.
|
protected DataRenderer |
mRenderer
object responsible for rendering the data
|
protected OnChartValueSelectedListener |
mSelectionListener
listener that is called when a value on the chart is selected
|
protected boolean |
mTouchEnabled
if true, touch gestures are enabled on the chart
|
protected ViewPortHandler |
mViewPortHandler
object that manages the bounds and drawing constraints of the chart
|
protected XAxis |
mXAxis
the object representing the labels on the x-axis
|
static int |
PAINT_CENTER_TEXT
paint for the text in the middle of the pie chart
|
static int |
PAINT_DESCRIPTION
paint for the description text in the bottom right corner
|
static int |
PAINT_GRID_BACKGROUND
paint for the grid background (only line and barchart)
|
static int |
PAINT_HOLE
paint for the hole in the middle of the pie chart
|
static int |
PAINT_INFO
paint for the info text that is displayed when there are no values in the
chart
|
static int |
PAINT_LEGEND_LABEL
paint used for the legend
|
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHEACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z| Constructor and Description |
|---|
Chart(android.content.Context context)
default constructor for initialization in code
|
Chart(android.content.Context context,
android.util.AttributeSet attrs)
constructor for initialization in xml
|
Chart(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
even more awesome constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addViewportJob(java.lang.Runnable job)
Either posts a job immediately if the chart has already setup it's
dimensions or adds the job to the execution queue.
|
void |
animateX(int durationMillis)
Animates the rendering of the chart on the x-axis with the specified
animation time.
|
void |
animateX(int durationMillis,
Easing.EasingFunction easing)
Animates the rendering of the chart on the x-axis with the specified
animation time.
|
void |
animateXY(int durationMillisX,
int durationMillisY)
Animates the drawing / rendering of the chart on both x- and y-axis with
the specified animation time.
|
void |
animateXY(int durationMillisX,
int durationMillisY,
Easing.EasingFunction easing)
Animates the drawing / rendering of the chart on both x- and y-axis with
the specified animation time.
|
void |
animateXY(int durationMillisX,
int durationMillisY,
Easing.EasingFunction easingX,
Easing.EasingFunction easingY)
Animates the drawing / rendering of the chart on both x- and y-axis with
the specified animation time.
|
void |
animateY(int durationMillis)
Animates the rendering of the chart on the y-axis with the specified
animation time.
|
void |
animateY(int durationMillis,
Easing.EasingFunction easing)
Animates the rendering of the chart on the y-axis with the specified
animation time.
|
protected abstract void |
calcMinMax()
Calculates the y-min and y-max value and the y-delta and x-delta value
|
protected abstract void |
calculateOffsets()
Calculates the offsets of the chart to the border depending on the
position of an eventual legend or depending on the length of the y-axis
and x-axis labels and their position
|
void |
clear()
Clears the chart from all data (sets it to null) and refreshes it (by
calling invalidate()).
|
void |
clearAllViewportJobs() |
void |
clearValues()
Removes all DataSets (and thereby Entries) from the chart.
|
void |
disableScroll()
disables intercept touchevents
|
protected void |
drawDescription(android.graphics.Canvas c)
Draws the description text in the bottom right corner of the chart (per default)
|
protected void |
drawMarkers(android.graphics.Canvas canvas)
draws all MarkerViews on the highlighted positions
|
void |
enableScroll()
enables intercept touchevents
|
ChartAnimator |
getAnimator()
Returns the animator responsible for animating chart values.
|
MPPointF |
getCenter()
Returns a recyclable MPPointF instance.
|
MPPointF |
getCenterOffsets()
Returns a recyclable MPPointF instance.
|
MPPointF |
getCenterOfView()
Returns a recyclable MPPointF instance.
|
android.graphics.Bitmap |
getChartBitmap()
Returns the bitmap that represents the chart.
|
android.graphics.RectF |
getContentRect()
Returns the rectangle that defines the borders of the chart-value surface
(into which the actual values are drawn).
|
T |
getData()
Returns the ChartData object that has been set for the chart.
|
ValueFormatter |
getDefaultValueFormatter()
Returns the default IValueFormatter that has been determined by the chart
considering the provided minimum and maximum values.
|
Description |
getDescription()
Returns the Description object of the chart that is responsible for holding all information related
to the description text that is displayed in the bottom right corner of the chart (by default).
|
float |
getDragDecelerationFrictionCoef()
Returns drag deceleration friction coefficient
|
float |
getExtraBottomOffset() |
float |
getExtraLeftOffset() |
float |
getExtraRightOffset() |
float |
getExtraTopOffset() |
Highlight |
getHighlightByTouchPoint(float x,
float y)
Returns the Highlight object (contains x-index and DataSet index) of the
selected value at the given touch point inside the Line-, Scatter-, or
CandleStick-Chart.
|
Highlight[] |
getHighlighted()
Returns the array of currently highlighted values.
|
IHighlighter |
getHighlighter() |
java.util.ArrayList<java.lang.Runnable> |
getJobs()
Returns all jobs that are scheduled to be executed after
onSizeChanged(...).
|
Legend |
getLegend()
Returns the Legend object of the chart.
|
LegendRenderer |
getLegendRenderer()
Returns the renderer object responsible for rendering / drawing the
Legend.
|
IMarker |
getMarker()
returns the marker that is set as a marker view for the chart
|
protected float[] |
getMarkerPosition(Highlight high)
Returns the actual position in pixels of the MarkerView for the given
Highlight object.
|
IMarker |
getMarkerView()
Deprecated.
|
float |
getMaxHighlightDistance()
Returns the maximum distance in scren dp a touch can be away from an entry to cause it to get highlighted.
|
OnChartGestureListener |
getOnChartGestureListener()
Returns the custom gesture listener.
|
ChartTouchListener |
getOnTouchListener()
Returns an instance of the currently active touch listener.
|
android.graphics.Paint |
getPaint(int which)
Returns the paint object associated with the provided constant.
|
DataRenderer |
getRenderer()
Returns the Renderer object the chart uses for drawing data.
|
ViewPortHandler |
getViewPortHandler()
Returns the ViewPortHandler of the chart that is responsible for the
content area of the chart and its offsets and dimensions.
|
XAxis |
getXAxis()
Returns the object representing all x-labels, this method can be used to
acquire the XAxis object and modify it (e.g.
|
float |
getXChartMax()
Returns the maximum x value of the chart, regardless of zoom or translation.
|
float |
getXChartMin()
Returns the minimum x value of the chart, regardless of zoom or translation.
|
float |
getXRange() |
float |
getYMax()
returns the current y-max value across all DataSets
|
float |
getYMin()
returns the current y-min value across all DataSets
|
void |
highlightValue(float x,
float y,
int dataSetIndex)
Highlights the value at the given x-value and y-value in the given DataSet.
|
void |
highlightValue(float x,
float y,
int dataSetIndex,
boolean callListener)
Highlights any y-value at the given x-value in the given DataSet.
|
void |
highlightValue(float x,
float y,
int dataSetIndex,
int dataIndex)
Highlights the value at the given x-value and y-value in the given DataSet.
|
void |
highlightValue(float x,
float y,
int dataSetIndex,
int dataIndex,
boolean callListener)
Highlights any y-value at the given x-value in the given DataSet.
|
void |
highlightValue(float x,
int dataSetIndex)
Highlights any y-value at the given x-value in the given DataSet.
|
void |
highlightValue(float x,
int dataSetIndex,
boolean callListener)
Highlights any y-value at the given x-value in the given DataSet.
|
void |
highlightValue(float x,
int dataSetIndex,
int dataIndex)
Highlights any y-value at the given x-value in the given DataSet.
|
void |
highlightValue(float x,
int dataSetIndex,
int dataIndex,
boolean callListener)
Highlights any y-value at the given x-value in the given DataSet.
|
void |
highlightValue(Highlight highlight)
Highlights the values represented by the provided Highlight object
This method *will not* call the listener.
|
void |
highlightValue(Highlight high,
boolean callListener)
Highlights the value selected by touch gesture.
|
void |
highlightValues(Highlight[] highs)
Highlights the values at the given indices in the given DataSets.
|
protected void |
init()
initialize all paints and stuff
|
boolean |
isDragDecelerationEnabled()
If set to true, chart continues to scroll after touch up default: true
|
boolean |
isDrawMarkersEnabled()
returns true if drawing the marker is enabled when tapping on values
(use the setMarker(IMarker marker) method to specify a marker)
|
boolean |
isDrawMarkerViewsEnabled()
Deprecated.
|
boolean |
isEmpty()
Returns true if the chart is empty (meaning it's data object is either
null or contains no entries).
|
boolean |
isHighlightPerTapEnabled()
Returns true if values can be highlighted via tap gesture, false if not.
|
boolean |
isLogEnabled()
Returns true if log-output is enabled for the chart, fals if not.
|
abstract void |
notifyDataSetChanged()
Lets the chart know its underlying data has changed and performs all
necessary recalculations.
|
protected void |
onDetachedFromWindow() |
protected void |
onDraw(android.graphics.Canvas canvas) |
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom) |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
void |
removeViewportJob(java.lang.Runnable job) |
boolean |
saveToGallery(java.lang.String fileName)
Saves the current state of the chart to the gallery as a PNG image.
|
boolean |
saveToGallery(java.lang.String fileName,
int quality)
Saves the current state of the chart to the gallery as a JPEG image.
|
boolean |
saveToGallery(java.lang.String fileName,
java.lang.String subFolderPath,
java.lang.String fileDescription,
android.graphics.Bitmap.CompressFormat format,
int quality)
Saves the current state of the chart to the gallery as an image type.
|
boolean |
saveToPath(java.lang.String title,
java.lang.String pathOnSD)
Saves the current chart state with the given name to the given path on
the sdcard leaving the path empty "" will put the saved file directly on
the SD card chart is saved as a PNG image, example:
saveToPath("myfilename", "foldername1/foldername2");
|
void |
setData(T data)
Sets a new data object for the chart.
|
void |
setDescription(Description desc)
Sets a new Description object for the chart.
|
void |
setDragDecelerationEnabled(boolean enabled)
If set to true, chart continues to scroll after touch up.
|
void |
setDragDecelerationFrictionCoef(float newValue)
Deceleration friction coefficient in [0 ; 1] interval, higher values
indicate that speed will decrease slowly, for example if it set to 0, it
will stop immediately.
|
void |
setDrawMarkers(boolean enabled)
Set this to true to draw a user specified marker when tapping on
chart values (use the setMarker(IMarker marker) method to specify a
marker).
|
void |
setDrawMarkerViews(boolean enabled)
Deprecated.
|
void |
setExtraBottomOffset(float offset)
Set an extra offset to be appended to the viewport's bottom
|
void |
setExtraLeftOffset(float offset)
Set an extra offset to be appended to the viewport's left
|
void |
setExtraOffsets(float left,
float top,
float right,
float bottom)
Sets extra offsets (around the chart view) to be appended to the
auto-calculated offsets.
|
void |
setExtraRightOffset(float offset)
Set an extra offset to be appended to the viewport's right
|
void |
setExtraTopOffset(float offset)
Set an extra offset to be appended to the viewport's top
|
void |
setHardwareAccelerationEnabled(boolean enabled)
Setting this to true will set the layer-type HARDWARE for the view, false
will set layer-type SOFTWARE.
|
void |
setHighlighter(ChartHighlighter highlighter)
Sets a custom highligher object for the chart that handles / processes
all highlight touch events performed on the chart-view.
|
void |
setHighlightPerTapEnabled(boolean enabled)
Set this to false to prevent values from being highlighted by tap gesture.
|
protected void |
setLastHighlighted(Highlight[] highs)
Sets the last highlighted value for the touchlistener.
|
void |
setLogEnabled(boolean enabled)
Set this to true to enable logcat outputs for the chart.
|
void |
setMarker(IMarker marker)
sets the marker that is displayed when a value is clicked on the chart
|
void |
setMarkerView(IMarker v)
Deprecated.
|
void |
setMaxHighlightDistance(float distDp)
Sets the maximum distance in screen dp a touch can be away from an entry to cause it to get highlighted.
|
void |
setNoDataText(java.lang.String text)
Sets the text that informs the user that there is no data available with
which to draw the chart.
|
void |
setNoDataTextAlignment(android.graphics.Paint.Align align)
alignment of the no data text
|
void |
setNoDataTextColor(int color)
Sets the color of the no data text.
|
void |
setNoDataTextTypeface(android.graphics.Typeface tf)
Sets the typeface to be used for the no data text.
|
void |
setOnChartGestureListener(OnChartGestureListener l)
Sets a gesture-listener for the chart for custom callbacks when executing
gestures on the chart surface.
|
void |
setOnChartValueSelectedListener(OnChartValueSelectedListener l)
set a selection listener for the chart
|
void |
setOnTouchListener(ChartTouchListener l)
Set a new (e.g.
|
void |
setPaint(android.graphics.Paint p,
int which)
set a new paint object for the specified parameter in the chart e.g.
|
void |
setRenderer(DataRenderer renderer)
Sets a new DataRenderer object for the chart.
|
void |
setTouchEnabled(boolean enabled)
Set this to false to disable all gestures and touches on the chart,
default: true
|
void |
setUnbindEnabled(boolean enabled)
Set this to true to enable "unbinding" of drawables.
|
protected void |
setupDefaultFormatter(float min,
float max)
Calculates the required number of digits for the values that might be
drawn in the chart (if enabled), and creates the default-value-formatter
|
boolean |
valuesToHighlight()
Returns true if there are values to highlight, false if there are no
values to highlight.
|
addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, checkLayoutParams, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDescendantInvalidated, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, shouldDelayChildPressedState, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayoutaddExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHeight, getMaxVisibleCount, getWidth, getYChartMax, getYChartMincanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayoutpublic static final java.lang.String LOG_TAG
protected boolean mLogEnabled
protected T extends ChartData<? extends IDataSet<? extends Entry>> mData
protected boolean mHighLightPerTapEnabled
protected DefaultValueFormatter mDefaultValueFormatter
protected android.graphics.Paint mDescPaint
protected android.graphics.Paint mInfoPaint
protected XAxis mXAxis
protected boolean mTouchEnabled
protected Description mDescription
protected Legend mLegend
protected OnChartValueSelectedListener mSelectionListener
protected ChartTouchListener mChartTouchListener
protected LegendRenderer mLegendRenderer
protected DataRenderer mRenderer
protected IHighlighter mHighlighter
protected ViewPortHandler mViewPortHandler
protected ChartAnimator mAnimator
protected Highlight[] mIndicesToHighlight
protected float mMaxHighlightDistance
protected boolean mDrawMarkers
protected IMarker mMarker
public static final int PAINT_GRID_BACKGROUND
public static final int PAINT_INFO
public static final int PAINT_DESCRIPTION
public static final int PAINT_HOLE
public static final int PAINT_CENTER_TEXT
public static final int PAINT_LEGEND_LABEL
protected java.util.ArrayList<java.lang.Runnable> mJobs
public Chart(android.content.Context context)
public Chart(android.content.Context context,
android.util.AttributeSet attrs)
public Chart(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
protected void init()
public void setData(T data)
data - public void clear()
public void clearValues()
public boolean isEmpty()
public abstract void notifyDataSetChanged()
protected abstract void calculateOffsets()
protected abstract void calcMinMax()
protected void setupDefaultFormatter(float min,
float max)
protected void onDraw(android.graphics.Canvas canvas)
onDraw in class android.view.Viewprotected void drawDescription(android.graphics.Canvas c)
public float getMaxHighlightDistance()
ChartInterfacegetMaxHighlightDistance in interface ChartInterfacepublic void setMaxHighlightDistance(float distDp)
distDp - public Highlight[] getHighlighted()
public boolean isHighlightPerTapEnabled()
public void setHighlightPerTapEnabled(boolean enabled)
enabled - public boolean valuesToHighlight()
protected void setLastHighlighted(Highlight[] highs)
highs - public void highlightValues(Highlight[] highs)
highs - public void highlightValue(float x,
int dataSetIndex,
int dataIndex)
x - The x-value to highlightdataSetIndex - The dataset index to search indataIndex - The data index to search in (only used in CombinedChartView currently)public void highlightValue(float x,
int dataSetIndex)
x - The x-value to highlightdataSetIndex - The dataset index to search inpublic void highlightValue(float x,
float y,
int dataSetIndex,
int dataIndex)
x - The x-value to highlighty - The y-value to highlight. Supply `NaN` for "any"dataSetIndex - The dataset index to search indataIndex - The data index to search in (only used in CombinedChartView currently)public void highlightValue(float x,
float y,
int dataSetIndex)
x - The x-value to highlighty - The y-value to highlight. Supply `NaN` for "any"dataSetIndex - The dataset index to search inpublic void highlightValue(float x,
int dataSetIndex,
int dataIndex,
boolean callListener)
x - The x-value to highlightdataSetIndex - The dataset index to search indataIndex - The data index to search in (only used in CombinedChartView currently)callListener - Should the listener be called for this changepublic void highlightValue(float x,
int dataSetIndex,
boolean callListener)
x - The x-value to highlightdataSetIndex - The dataset index to search incallListener - Should the listener be called for this changepublic void highlightValue(float x,
float y,
int dataSetIndex,
int dataIndex,
boolean callListener)
x - The x-value to highlighty - The y-value to highlight. Supply `NaN` for "any"dataSetIndex - The dataset index to search indataIndex - The data index to search in (only used in CombinedChartView currently)callListener - Should the listener be called for this changepublic void highlightValue(float x,
float y,
int dataSetIndex,
boolean callListener)
x - The x-value to highlighty - The y-value to highlight. Supply `NaN` for "any"dataSetIndex - The dataset index to search incallListener - Should the listener be called for this changepublic void highlightValue(Highlight highlight)
highlight - contains information about which entry should be highlightedpublic void highlightValue(Highlight high, boolean callListener)
high - - the highlight objectcallListener - - call the listenerpublic Highlight getHighlightByTouchPoint(float x, float y)
x - y - public void setOnTouchListener(ChartTouchListener l)
l - public ChartTouchListener getOnTouchListener()
protected void drawMarkers(android.graphics.Canvas canvas)
protected float[] getMarkerPosition(Highlight high)
high - public ChartAnimator getAnimator()
public boolean isDragDecelerationEnabled()
public void setDragDecelerationEnabled(boolean enabled)
enabled - public float getDragDecelerationFrictionCoef()
public void setDragDecelerationFrictionCoef(float newValue)
newValue - public void animateXY(int durationMillisX,
int durationMillisY,
Easing.EasingFunction easingX,
Easing.EasingFunction easingY)
durationMillisX - durationMillisY - easingX - a custom easing function to be used on the animation phaseeasingY - a custom easing function to be used on the animation phasepublic void animateXY(int durationMillisX,
int durationMillisY,
Easing.EasingFunction easing)
durationMillisX - durationMillisY - easing - a custom easing function to be used on the animation phasepublic void animateX(int durationMillis,
Easing.EasingFunction easing)
durationMillis - easing - a custom easing function to be used on the animation phasepublic void animateY(int durationMillis,
Easing.EasingFunction easing)
durationMillis - easing - a custom easing function to be used on the animation phasepublic void animateX(int durationMillis)
durationMillis - public void animateY(int durationMillis)
durationMillis - public void animateXY(int durationMillisX,
int durationMillisY)
durationMillisX - durationMillisY - public XAxis getXAxis()
public ValueFormatter getDefaultValueFormatter()
getDefaultValueFormatter in interface ChartInterfacepublic void setOnChartValueSelectedListener(OnChartValueSelectedListener l)
l - public void setOnChartGestureListener(OnChartGestureListener l)
l - public OnChartGestureListener getOnChartGestureListener()
public float getYMax()
public float getYMin()
public float getXChartMax()
ChartInterfacegetXChartMax in interface ChartInterfacepublic float getXChartMin()
ChartInterfacegetXChartMin in interface ChartInterfacepublic float getXRange()
getXRange in interface ChartInterfacepublic MPPointF getCenter()
public MPPointF getCenterOffsets()
getCenterOffsets in interface ChartInterfacepublic void setExtraOffsets(float left,
float top,
float right,
float bottom)
left - top - right - bottom - public void setExtraTopOffset(float offset)
public float getExtraTopOffset()
public void setExtraRightOffset(float offset)
public float getExtraRightOffset()
public void setExtraBottomOffset(float offset)
public float getExtraBottomOffset()
public void setExtraLeftOffset(float offset)
public float getExtraLeftOffset()
public void setLogEnabled(boolean enabled)
enabled - public boolean isLogEnabled()
public void setNoDataText(java.lang.String text)
text - public void setNoDataTextColor(int color)
color - public void setNoDataTextTypeface(android.graphics.Typeface tf)
tf - public void setNoDataTextAlignment(android.graphics.Paint.Align align)
align - public void setTouchEnabled(boolean enabled)
enabled - public void setMarker(IMarker marker)
marker - public IMarker getMarker()
@Deprecated public void setMarkerView(IMarker v)
@Deprecated public IMarker getMarkerView()
public void setDescription(Description desc)
desc - public Description getDescription()
public Legend getLegend()
public LegendRenderer getLegendRenderer()
public android.graphics.RectF getContentRect()
getContentRect in interface ChartInterfacepublic void disableScroll()
public void enableScroll()
public void setPaint(android.graphics.Paint p,
int which)
p - the new paint objectwhich - Chart.PAINT_VALUES, Chart.PAINT_GRID, Chart.PAINT_VALUES,
...public android.graphics.Paint getPaint(int which)
which - e.g. Chart.PAINT_LEGEND_LABEL@Deprecated public boolean isDrawMarkerViewsEnabled()
@Deprecated public void setDrawMarkerViews(boolean enabled)
public boolean isDrawMarkersEnabled()
public void setDrawMarkers(boolean enabled)
enabled - public T getData()
getData in interface ChartInterfacepublic ViewPortHandler getViewPortHandler()
public DataRenderer getRenderer()
public void setRenderer(DataRenderer renderer)
renderer - public IHighlighter getHighlighter()
public void setHighlighter(ChartHighlighter highlighter)
highlighter - public MPPointF getCenterOfView()
getCenterOfView in interface ChartInterfacepublic android.graphics.Bitmap getChartBitmap()
public boolean saveToPath(java.lang.String title,
java.lang.String pathOnSD)
title - pathOnSD - e.g. "folder1/folder2/folder3"public boolean saveToGallery(java.lang.String fileName,
java.lang.String subFolderPath,
java.lang.String fileDescription,
android.graphics.Bitmap.CompressFormat format,
int quality)
fileName - e.g. "my_image"subFolderPath - e.g. "ChartPics"fileDescription - e.g. "Chart details"format - e.g. Bitmap.CompressFormat.PNGquality - e.g. 50, min = 0, max = 100public boolean saveToGallery(java.lang.String fileName,
int quality)
fileName - e.g. "my_image"quality - e.g. 50, min = 0, max = 100public boolean saveToGallery(java.lang.String fileName)
fileName - e.g. "my_image"public void removeViewportJob(java.lang.Runnable job)
public void clearAllViewportJobs()
public void addViewportJob(java.lang.Runnable job)
job - public java.util.ArrayList<java.lang.Runnable> getJobs()
protected void onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
onLayout in class android.view.ViewGroupprotected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onMeasure in class android.view.Viewprotected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
onSizeChanged in class android.view.Viewpublic void setHardwareAccelerationEnabled(boolean enabled)
enabled - protected void onDetachedFromWindow()
onDetachedFromWindow in class android.view.ViewGrouppublic void setUnbindEnabled(boolean enabled)
enabled -