core library

MPChartLib 1:1 entry point: every imperative chart class under its MPAndroidChart v4.0.1 name (the widget entry point calls them LineChartView & co.), and every type they use.

Not exported: the package-internal helpers that are Kotlin internal or have no Kotlin counterpart (utils/float_math.dart, animation/value_transition.dart, renderer/point_reducer.dart, charts/empty_state_layout.dart, decimalPattern, colorAt) and the widget layer, apart from the touch event and velocity tracker types that the core API uses (Chart.onTouchEvent, the touch listeners).

Classes

AbstractBuffer<T>
Reusable float buffer that holds the coordinates to draw, so drawing does not allocate: replace instead of recreate. feed fills buffer from data of type T; the subclass defines the layout of the floats.
AnimatedMoveViewJob
Animates the viewport from the value point (xOrigin, yOrigin) to (xValue, yValue). On every frame the interpolated point is placed at the top left corner of the content rectangle.
AnimatedViewPortJob
Base class of the viewport jobs that animate from an origin to a target over a duration. An animation drives phase from 0 to 1 and calls onAnimationUpdate on every frame, where subclasses apply the interpolated position. The job recycles itself when the animation ends or is cancelled.
AnimatedZoomJob
Animates the zoom of a chart from the absolute scale (xOrigin, yOrigin) to (xValue, yValue) while moving the viewport so that the centered value point travels from (zoomOriginX, zoomOriginY) to (zoomCenterX, zoomCenterY). Recalculates the chart offsets when the animation ends. Used instances are not returned to the pool.
AxisBase
Base of XAxis and YAxis: the value range, the label entries, grid and axis lines, limit lines and label formatting. Sizes are in dp and converted to px at draw time. The label entries are computed by the chart's axis renderer from the visible range, so they are empty until the chart has data and was laid out.
AxisRenderer
Base class of the axis renderers. Computes the label values of an axis from its visible range and draws its labels, grid lines, axis line and limit lines.
BarBuffer
Buffer of bar rectangles for one bar data set, in value space. Every bar takes four floats: left, top, right, bottom. Left and right are x values (x - barWidth / 2 and x + barWidth / 2), top and bottom are y values between the bar value and 0. A stacked entry produces one rectangle per stack value. The renderer converts the part of the buffer that was filled to pixels with a Transformer afterwards.
BarChart
Chart that draws BarData as vertical bars, plain, grouped or stacked. It implements BarDataProvider for the bar renderer and highlighter. See HorizontalBarChart for horizontal bars.
BarChartRenderer
Draws the bars of a BarDataProvider (a bar chart, or a combined chart with bar data). The bars of each data set are collected in a BarBuffer in value space, converted to pixels in one step and drawn as rectangles or custom fills. A highlight is drawn as a translucent rectangle over the selected bar or stack value.
BarData
Data for a bar chart: one or more IBarDataSets plus the shared bar width and grouping.
BarDataProvider
What the bar chart renderer and highlighter read from a chart that shows bars. Implemented by BarChart and the combined chart.
BarDataSet<D>
One group of bars in a bar chart. Bars may be stacked when their entries carry BarEntry.stackValues.
BarEntry<D>
Entry for a bar chart. A bar is either a single value in y or a stack of values in stackValues.
BarHighlighter
Highlighter for the bar chart.
BarLineChartBase<T extends BarLineScatterCandleBubbleData<IBarLineScatterCandleBubbleDataSet<Entry>>>
Base class of the charts with an x axis and two y axes: LineChart, BarChart, ScatterChart, CandleStickChart, BubbleChart and CombinedChart. It adds the axes, zooming, dragging and the viewport functions, and implements BarLineScatterCandleBubbleDataProvider for the renderers.
BarLineChartTouchListener
Touch handling for bar, line, scatter, candle and bubble charts: tap to highlight, double tap to zoom in, single finger drag to pan (or to move the highlight when the chart cannot pan), two finger pinch to zoom, and fling with deceleration.
BarLineScatterCandleBubbleData<T extends IBarLineScatterCandleBubbleDataSet<Entry>>
Base for the data objects of the charts with an x and a y axis (bar, line, scatter, candle, bubble and combined). Adds nothing to ChartData beyond the set type; it lets a combined chart treat them alike.
BarLineScatterCandleBubbleDataProvider
What charts with an x axis and two y axes expose to their renderers and highlighters. Implemented by BarLineChartBase.
BarLineScatterCandleBubbleDataSet<T extends Entry>
Base for the data sets of the charts with an x and a y axis (bar, line, scatter, candle and bubble). Adds the highlight color those charts share.
BarLineScatterCandleBubbleRenderer
Base class of the renderers for charts with x and y axes (bar, line, scatter, candle, bubble). Adds helpers that limit drawing to the entries visible on screen.
BaseDataSet<T extends Entry>
Styling and bookkeeping shared by every data set: colors, value labels, legend form, axis and visibility. Entry storage is left to DataSet; the entry related overrides here work through getEntryForIndex.
BaseEntry<D>
Common part of every chart entry: a y value, an optional icon and a read-only payload.
BubbleChart
Chart that draws BubbleData as circles whose area, not radius, represents the entry size. It implements BubbleDataProvider for the bubble renderer.
BubbleChartRenderer
Draws the bubbles of a BubbleDataProvider. Each entry is a filled circle at its x and y value whose diameter follows the entry size relative to the largest size of its data set. A highlight redraws the outline of the bubble in a darker shade of its color.
BubbleData
Data for a bubble chart: one or more IBubbleDataSets.
BubbleDataProvider
What the bubble chart renderer reads from a chart that shows bubbles. Implemented by BubbleChart and the combined chart.
BubbleDataSet<D>
One series of bubbles in a bubble chart.
BubbleEntry<D>
Entry for a bubble chart: a point plus the bubble's size.
CandleData
Data for a candle stick chart: one or more ICandleDataSets.
CandleDataProvider
What the candle stick renderer reads from a chart that shows candles. Implemented by CandleStickChart and the combined chart.
CandleDataSet<D>
One series of candles in a candle stick chart. The y range covers the candles' low to high values.
CandleEntry<D>
Entry for a candle stick chart with the high, low, open and close values of one candle. The inherited y is set once at construction to the middle between high and low and does not follow later changes to those properties.
CandleStickChart
Chart that draws CandleData as candlesticks with open, high, low and close values, as used for prices. It implements CandleDataProvider for the candle renderer.
CandleStickChartRenderer
Draws the candles of a CandleDataProvider. With showCandleBar an entry becomes a body from open to close plus a shadow line from high to low; otherwise it is drawn as a high-low line with an open tick on the left and a close tick on the right. Colors follow whether the entry increased, decreased or stayed equal.
Chart<T extends ChartData<IDataSet<Entry>>>
Base class of every chart. It owns the data, the axis, legend and description components, the paints, highlighting, markers, animation and the viewport jobs that all chart types share.
ChartAnimator
Runs the animations of a chart. It drives phaseX and phaseY from 0 to 1 with an AnimationController; the renderers draw only the first phaseX share of the entries and scale their values by phaseY. It also runs the chart's spin and value animations. Every chart owns one and passes a callback that redraws the chart on each animation frame.
ChartData<T extends IDataSet<Entry>>
Everything a chart draws: a list of data sets plus the cached x and y ranges over all of them, split by y axis. The ranges are computed once at construction and again by notifyDataChanged; adding sets or entries through this class widens them on the fly, changing a set in place does not.
ChartDrawable
Something that can be drawn into a rectangle, standing in for android.graphics.drawable.Drawable.
ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider>
Default highlighter for line, scatter, candle and bubble charts.
ChartHost
What a chart needs from whatever shows it on screen: the render object of the widget layer implements it and assigns itself to Chart.host.
ChartInterface
What every chart exposes to its renderers, highlighters and markers: value ranges, layout in pixels and the data. Implemented by Chart.
ChartInvalidator
Something that can be asked to redraw, the part of android.view.View that ViewPortHandler needs.
ChartPaint
The style and color of drawing, standing in for android.graphics.Paint.
ChartTouchEvent
One touch event as the chart touch listeners see it: the gesture recognizer folds Flutter's pointer events into these, shaped like Android's MotionEvent, so the ported state machines read them unchanged.
ChartTouchListener<T extends Chart<ChartData<IDataSet<Entry>>>>
Base class for the touch handling of a chart. Every chart creates one touch listener for itself: BarLineChartTouchListener for bar, line, scatter, candle and bubble charts and PieRadarChartTouchListener for pie and radar charts.
ChartVelocityTracker
Measures the velocity of each pointer of a touch gesture, standing in for Android's VelocityTracker.
ChevronDownShapeRenderer
Draws a scatter entry as a downward pointing chevron (an open V) with a 1 dp stroke. The tip sits one shape size below the entry position.
ChevronUpShapeRenderer
Draws a scatter entry as an upward pointing chevron (an open inverted V) with a 1 dp stroke. The tip sits one shape size above the entry position.
CircleShapeRenderer
Draws a scatter entry as a ring whose outer diameter is the shape size and whose hole has the hole radius of the data set, a full disc when the hole radius is 0. The hole is filled with the hole color when one is set.
ColorTemplate
Ready-made color lists for data sets and small color helpers.
ComponentBase
Settings shared by every chart component that draws text: the axes, the legend, limit lines and the description.
CrossShapeRenderer
Draws a scatter entry as a plus sign of the shape size with a 1 dp stroke.
DashPathEffect
A dash pattern for stroked lines and paths, like android.graphics.DashPathEffect; applied by dashPath (dash_path.dart).
DataRenderer
Base class of the renderers that draw chart data (bars, lines, slices, ...).
DataSet<T extends Entry>
A group of entries that belong together, for example one line in a line chart or one group of bars. Holds the entries and caches their x and y ranges. Entries must be sorted by x ascending for the x value lookups (getEntryForXValue, getEntryIndex, getEntriesForXValue) to work. Looking an entry up by the entry itself works either way; sorted entries only make it faster.
DecimalFormat
A minimal java.text.DecimalFormat for the number patterns MPAndroidChart uses, such as ###,###,###,##0.0, ###,###,###,##0, ###,###,##0.# and #.##.
DefaultAxisValueFormatter
Formats axis labels with a fixed number of decimal digits and thousands separators. An axis creates one with its computed AxisBase.decimals while no formatter is assigned.
DefaultFillFormatter
Fill position used by line data sets that set no formatter. The fill reaches the zero line when the data set or the whole line data has values on both sides of zero, otherwise the axis minimum for a positive data set and the axis maximum for a negative one. Returns 0 while the chart has no line data.
DefaultValueFormatter
Formats values with a fixed number of decimal digits and thousands separators, for example 1,234.50. The chart creates one with a digit count derived from its data range and uses it wherever no formatter is set.
Description
A short text drawn on the chart, by default at the bottom right corner of the content area.
Easing
Easing curves for ChartAnimator. Each maps animation progress 0..1 to an eased value that is 0 at 0 and 1 at 1; the elastic, back and bounce curves overshoot in between. EaseIn starts slow, EaseOut ends slow, EaseInOut does both.
Entry<D>
One point in a chart: an x value, a y value, an optional icon and a typed payload. Used directly by line and scatter charts; the other chart types use subclasses.
EntryXComparator
Orders entries by their x value, ascending. Use it to sort entries before creating a data set, which expects them in x order.
FileUtils
Loads entries from simple text assets, one entry per line with values separated by "#".
Fill
Describes how an area is filled: with nothing, a solid color, a linear gradient or a drawable.
FontMetrics
The vertical metrics of a font in pixels, relative to the baseline, like Paint.FontMetrics: values above the baseline are negative, values below it positive.
FSize
Mutable width and height pair, usually a size in pixels such as measured text bounds.
Highlight
Identifies one selected value in a chart: which entry it is, where it sits on screen and which data set, axis and, for stacked bars, which stack value it belongs to.
HorizontalBarBuffer
BarBuffer for horizontal bar charts. The four floats per bar are still left, top, right, bottom, but here left and right are y values (the bar value and 0) and top and bottom are x values (x - barWidth / 2 and x + barWidth / 2), matching the swapped axes of the chart.
HorizontalBarChart
BarChart with horizontal bars. The axes swap roles on screen: the xAxis runs vertically along the bars and the two y axes run horizontally along the values. The visible range setters and touch helpers take that swap into account, so callers keep using x for entries and y for values.
HorizontalBarChartRenderer
Draws the bars of a horizontal bar chart, where the x values run along the vertical axis and the bar values along the horizontal axis. Uses a HorizontalBarBuffer per data set and places value labels to the right of the bars (to the left for negative values).
HorizontalBarHighlighter
Highlighter for the horizontal bar chart, where x values run along the vertical screen axis.
HorizontalViewPortHandler
Viewport handler used by the horizontal bar chart. Behaves exactly like ViewPortHandler.
IAxisValueFormatter
Formats the labels of an axis. Set it with AxisBase.valueFormatter. Usage: IAxisValueFormatter.fromFunction((value, axis) => value.toInt().toString()). Called for every label on every frame, so avoid allocations and heavy work.
IBarDataSet<D>
What the bar chart renderer reads from a data set: fills, borders, shadows and stack information. Implemented by BarDataSet.
IBarLineScatterCandleBubbleDataSet<T extends Entry>
Styling shared by data sets of charts with an x axis and y axes: bar, line, scatter, candle and bubble.
IBubbleDataSet<D>
What the bubble chart renderer reads from a data set: bubble sizing and the highlight ring. Implemented by BubbleDataSet.
ICandleDataSet<D>
What the candle stick renderer reads from a data set: candle body width, colors per direction and the shadow line. Implemented by CandleDataSet.
IDataSet<T extends Entry>
A set of entries with shared styling, the unit a chart draws as one line, one group of bars, one pie and so on. Renderers and highlighters only read this interface; the concrete data set classes in data/ implement it and inherit these docs.
IFillFormatter
Decides the y value, in value space, down or up to which a line data set is filled. Only used when the data set draws a fill. Usage: IFillFormatter.fromFunction((dataSet, dataProvider) => 0) fills to the zero line.
IHighlighter
Finds the value to highlight for a touch position. Every chart owns one highlighter and asks it on tap and, if enabled, while dragging.
ILineDataSet<D>
What the line chart renderer reads from a data set: line mode, circles at the entries, dashing and fill. Implemented by LineDataSet.
ILineRadarDataSet<T extends Entry>
Styling of the line and the filled area below it, shared by line and radar data sets.
ILineScatterCandleRadarDataSet<T extends Entry>
Styling of the highlight indicator lines shared by line, scatter, candle and radar data sets.
ImageDrawable
A ChartDrawable that draws a decoded ui.Image, like a BitmapDrawable.
IMarker
Something drawn at a highlighted value, such as a popup with details. Assign it to Chart.marker; the chart then calls refreshContent followed by draw for every highlighted entry. Positions and offsets are in px on the chart view.
IndexAxisValueFormatter
Shows a fixed label per whole x value, taking the label at index x from values. Use it on the x-axis when the x values are indices into a list of names, together with an AxisBase.granularity of 1.
IPieDataSet<D>
What the pie chart renderer reads from a data set: slice spacing, selection shift and the placement of value labels with their connector lines. Implemented by PieDataSet.
IRadarDataSet<D>
What the radar chart renderer reads from a data set: the corner rounding of the polygon and the ring drawn around a highlighted entry. Implemented by RadarDataSet.
IScatterDataSet<D>
What the scatter chart renderer reads from a data set: shape size, hole and the renderer that draws the shape. Implemented by ScatterDataSet.
IShapeRenderer
Draws the shape of one scatter entry. Assign an implementation to ScatterDataSet.shapeRenderer, either one of the built-in shapes or a function: IShapeRenderer.fromFunction((c, set, vph, x, y, paint) => c.drawCircleP(x, y, 4, paint)).
IValueFormatter
Formats the values drawn next to the entries inside the chart. Set it on a data set or on the chart data. Usage: IValueFormatter.fromFunction((value, entry, dataSetIndex, viewPortHandler) => value.toInt().toString()). Called for every drawn value on every frame, so avoid allocations and heavy work.
LargeValueFormatter
Shortens large numbers with a suffix per power of one thousand: 856 stays 856, 5821 becomes 5.8k, 101800 becomes 102k, 7800000 becomes 7.8m and 1000000000 becomes 1b. Works as value formatter and as axis formatter. Numbers below one thousand and numbers beyond the last entry of suffix are written out with one decimal.
Legend
The legend of a chart. By default it shows one entry per data set, or one per color for data sets with several colors, recomputed whenever the chart data changes. Assign entries to show your own entries instead. Sizes and spacings are in dp and converted to px in calculateDimensions.
LegendEntry
One entry of a Legend: a form followed by a label. NaN sizes and a null dash effect fall back to the legend's values.
LegendRenderer
Draws the Legend of a chart. computeLegend builds the legend entries from the data sets and measures the legend; renderLegend then draws the forms and labels at the position given by the legend's alignment, orientation and direction. Assign a subclass to chart.legendRenderer to change the drawing.
LimitLine
A line at a fixed value on an axis with an optional label, for example a target or a threshold. Add it with AxisBase.addLimitLine: on a YAxis it runs horizontally, on an XAxis vertically.
LineChart
Chart that draws LineData as straight, stepped or curved lines with optional circles and filled areas. It implements LineDataProvider for the line renderer.
LineChartRenderer
Draws the lines of a LineDataProvider. Supports the linear, stepped, cubic bezier and horizontal bezier modes, filled areas, dashed lines and circles at the entries. Every mode is drawn directly onto the chart canvas; circles are drawn in drawExtras.
LineData
Data for a line chart: one or more ILineDataSets, one per line.
LineDataProvider
What the line chart renderer reads from a chart that shows lines. Implemented by LineChart and the combined chart.
LineDataSet<D>
One line in a line chart, with its drawing mode, circle markers, dash pattern and fill settings.
LineRadarDataSet<T extends Entry>
Base for line and radar data sets: a stroked line with an optional filled area under it.
LineRadarRenderer
Base class of the line and radar renderers, which can fill the area enclosed by their line.
LineScatterCandleRadarDataSet<T extends Entry>
Base for the data sets whose highlight is drawn as crosshair lines (line, scatter, candle and radar). Holds the settings for those highlight lines.
LineScatterCandleRadarRenderer
Base class of the renderers that mark a selected entry with vertical and horizontal highlight lines.
MarkerImage
A marker that draws a drawable at the highlighted value. The chart sets chartView when the marker is assigned to it.
MarkerView
A marker drawn on the chart canvas at the highlighted value. Subclass it, implement measure and drawContent, and override refreshContent to update the content before each draw. The chart sets chartView when the marker is assigned to it.
Matrix
A 3×3 transformation matrix with the semantics of android.graphics.Matrix.
MoveViewJob
Moves the viewport so that the value point (xValue, yValue) lands at the top left corner of the content rectangle, without animation. Runs once, redraws the chart and returns itself to the pool.
MPPointD
Mutable point with double coordinates, used where chart values and pixel positions need the extra precision, for example by Transformer.
MPPointF
Mutable point with float coordinates, usually a pixel position.
MutableRect
A mutable rectangle with the semantics of android.graphics.RectF.
ObjectPool<T extends Poolable>
Pool that hands out and takes back instances of one Poolable type to avoid allocations while drawing.
OnChartGestureListener
Receives the touch gestures performed on a chart. Register it as chart.onChartGestureListener or add it to chart.gestureListeners.
OnChartValueSelectedListener
Receives the value the user selects in a chart by tapping or, when enabled, dragging. Register it as chart.onChartValueSelectedListener, add it to chart.valueSelectedListeners or use the chart.onValueSelected(...) shortcut.
PainterDrawable
A ChartDrawable that draws with a callback, for vector icons and custom shapes.
PercentFormatter
Appends " %" to each value, formatted with one decimal digit by default, for example "12.5 %". Meant for pie charts. Works as value formatter and as axis formatter.
PieChart
Chart that draws one PieData set as slices of a circle. Slice sizes are shares of the sum of all absolute y values; the first slice starts at rotationAngle and slices follow clockwise. Angles are in degrees.
PieChartRenderer
Draws a PieChart. drawData draws the slices, drawHighlighted the highlighted slices enlarged, and drawExtras the hole, the transparent ring around it and the center text. drawValues draws the entry labels and values inside or outside the slices. Angles are in degrees clockwise from 3 o'clock, offset by the chart's rotation angle; radii are pixels.
PieData
Data for a pie chart. Unlike the other data objects it holds exactly one set, whose entries are the slices; the legend is built from the entry labels, not from the set label.
PieDataSet<D>
The slices of a pie chart. A PieData holds exactly one of these. Only the y range is tracked, the x range stays at its empty values because pie entries have no x.
PieEntry<D>
Entry for a pie chart: one slice with a value and an optional label. A pie entry has no meaningful x; x is always 0 and the slice position is the entry's index in the data set.
PieHighlighter
Highlighter for the pie chart. A pie chart has one data set, so the slice index found by PieRadarHighlighter is the whole answer; the highlight carries the slice index as x, the slice value as y and the touch position as pixel position.
PieRadarChartBase<T extends ChartData<IDataSet<Entry>>>
Base class of the round charts, PieChart and RadarChart. It adds rotation by touch and the angle and distance helpers around the chart center. Angles are in degrees, 0 at 3 o'clock, increasing clockwise.
PieRadarChartTouchListener
Touch handling for pie and radar charts: tap to highlight, long press and single finger rotation with optional deceleration after the finger lifts.
PieRadarHighlighter<T extends PieRadarChartBase<ChartData<IDataSet<Entry>>>>
Shared highlighter logic for pie and radar charts.
Poolable
Base class for objects that can be stored in an ObjectPool (Kotlin ObjectPool.Poolable).
RadarChart
Chart that draws RadarData as a spider web: each entry sits on its own spoke from the center, and the entries of a data set are joined into a polygon. Works best with 5 to 10 entries per data set. The xAxis labels the spokes and yAxis scales the distance from the center. Angles are in degrees, 0 at 3 o'clock, increasing clockwise; the first spoke points at rotationAngle.
RadarChartRenderer
Draws a RadarChart: the web in drawExtras, one closed polygon per data set in drawData (filled when the data set enables it), the values at the corners in drawValues, and highlight lines and circles in drawHighlighted. Angles are in degrees clockwise from 3 o'clock, offset by the chart's rotation angle; radii are pixels.
RadarData
Data for a radar chart: one or more IRadarDataSets, one polygon each.
RadarDataSet<D>
One polygon in a radar chart. Each entry is the value on one axis of the web, in axis order.
RadarEntry<D>
Entry for a radar chart: one value on one axis of the web. x is always 0; the axis the value belongs to is the entry's index in the data set.
RadarHighlighter
Highlighter for the radar chart.
Range
The value span one value of a stacked bar entry covers, from where the previous value ended to where this one ends. Bar entries build one range per stack value; BarHighlighter uses them to find the touched stack value.
Renderer
Base class of everything that draws onto a chart canvas.
ScatterChart
Chart that draws ScatterData as one shape per entry. It implements ScatterDataProvider for the scatter renderer. Circles and squares draw fastest, triangles slowest.
ScatterChartRenderer
Draws the points of a ScatterDataProvider. Each entry is drawn at its pixel position by the shape renderer of its data set; a highlight is shown with the standard highlight lines.
ScatterData
Data for a scatter chart: one or more IScatterDataSets.
ScatterDataProvider
What the scatter chart renderer reads from a chart that shows scatter shapes. Implemented by ScatterChart and the combined chart.
ScatterDataSet<D>
One series of points in a scatter chart, all drawn with the same shape.
SquareShapeRenderer
Draws a scatter entry as a square frame whose outer side is the shape size and whose hole has the hole radius of the data set, a full square when the hole radius is 0. The hole is filled with the hole color when one is set. This is the default shape.
StackedValueFormatter
Formats the values of a stacked bar chart, labelling either every stack value or only the total on top of each bar. With drawWholeStack false, a stacked BarEntry gets its total (BarEntry.y) at the topmost stack value and an empty string for the others. The bar renderers pass the position in the stack, so a value that appears twice in one stack is handled correctly; a caller that formats a value itself, without the position, falls back to comparing values. Entries without a stack and drawWholeStack true format each value as it is.
TextMeasure
A least-recently-used cache of laid out TextPainters, so drawing and measuring the same label every frame does not lay it out again.
Transformer
Converts chart values to pixel positions and back for one y axis of a bar, line, scatter, candle or bubble chart.
TransformerHorizontalBarChart
Transformer for the horizontal bar chart, where an inverted axis mirrors the values along the x axis instead of the y axis.
TriangleShapeRenderer
Draws a scatter entry as an upward pointing triangle of the shape size. With a hole radius on the data set only the outline of that thickness is drawn, and the inner triangle is filled with the hole color when one is set.
Typeface
The font of a ChartPaint's text, standing in for android.graphics.Typeface.
Utils
Static helpers shared by all charts: dp to pixel conversion, text measuring and drawing, number formatting and small geometry functions.
ViewPortHandler
Keeps the current viewport of a chart: the chart size, the content rectangle the data is drawn in, and the touch matrix that holds the current zoom and drag state with its limits.
ViewPortJob
Base class of the jobs that move or zoom the viewport of a chart to a position given in value space.
XAxis
The horizontal axis of bar, line, scatter, candle and bubble charts, and the outer ring of a radar chart. Its values are the entries' x values, not their indices. Not every setting applies to the radar chart.
XAxisRenderer
Draws the x axis of charts with axes: the labels above or below the content rectangle, vertical grid lines, the axis line along the top or bottom edge and vertical limit lines. Assign a subclass to chart.rendererXAxis to change the drawing.
XAxisRendererHorizontalBarChart
Draws the x axis of a horizontal bar chart, where the x axis runs vertically: the labels left or right of the content rectangle, horizontal grid lines, the axis line along the left or right edge and horizontal limit lines. The x axis positions TOP and BOTTOM map to the right and left edge.
XAxisRendererRadarChart
Draws the x axis labels of a RadarChart: one label per entry index at the outer end of its spoke. Grid lines are part of the web drawn by the chart's data renderer, and limit lines are not supported.
XBounds
Index range of the entries of one data set that are currently visible. min and max are entry indices, not x values; range is the number of indices to draw after applying the x animation phase.
XShapeRenderer
Draws a scatter entry as a diagonal cross (an X) of the shape size with a 1 dp stroke.
YAxis
A vertical axis of bar, line, scatter, candle and bubble charts, and the value axis of a radar chart. Charts have a left and a right one; each data set picks its side with AxisDependency. Settings that change the value range must be applied before data is set.
YAxisRenderer
Draws a y axis of charts with axes: the labels along the left or right edge (inside or outside the content rectangle), horizontal grid lines, the zero line, the axis line and horizontal limit lines. Assign a subclass to chart.rendererLeftYAxis or chart.rendererRightYAxis to change the drawing.
YAxisRendererHorizontalBarChart
Draws a y axis of a horizontal bar chart, where the y axis runs horizontally: the left axis along the top edge and the right axis along the bottom edge, with vertical grid lines, a vertical zero line and vertical limit lines.
YAxisRendererRadarChart
Draws the y axis of a RadarChart: the label values along the spoke at the chart's rotation angle, and limit lines as closed polygons around the web. Grid lines and the axis line are part of the web drawn by the chart's data renderer.
ZoomJob
Zooms the viewport by the factors scaleX and scaleY relative to the current zoom and then moves it so that the value point (xValue, yValue) sits in the center of the content rectangle, without animation. Runs once, recalculates the chart offsets, redraws and returns itself to the pool.

Enums

AxisDependency
The y-axis a data set is plotted against: the LEFT or the RIGHT one.
BarCorners
Which corners of a bar get rounded.
ChartGesture
The kind of gesture the user performed on the chart, reported to OnChartGestureListener.
ChartTouchAction
The kind of a ChartTouchEvent, standing in for MotionEvent.getActionMasked().
FillDirection
Direction in which a linear gradient runs across the filled rectangle (Kotlin Fill.Direction): DOWN from the top edge, UP from the bottom edge, RIGHT from the left edge and LEFT from the right edge.
FillType
What a Fill paints with (Kotlin Fill.Type): EMPTY draws nothing, COLOR a solid Fill.color with Fill.alpha applied, LINEAR_GRADIENT a gradient built from Fill.gradientColors and Fill.gradientPositions, DRAWABLE the Fill.drawable stretched to the filled area.
HighlightLineSpan
How far a highlight line reaches across the chart. The near edge is the bottom of the content for the vertical line and its left for the horizontal one; the far edge is the top and the right.
LegendDirection
Order of form and label: LEFT_TO_RIGHT draws the form before the label and lays entries out to the right, RIGHT_TO_LEFT draws the label before the form and lays entries out to the left.
LegendForm
Shape drawn in front of a legend label.
LegendHorizontalAlignment
Horizontal placement of the legend: at the left edge, centered, or at the right edge of the chart.
LegendOrientation
Layout of the entries: HORIZONTAL in rows, wrapping when Legend.isWordWrapEnabled, or VERTICAL in one column.
LegendVerticalAlignment
Vertical placement of the legend: at the top edge, centered, or at the bottom edge of the chart.
LimitLabelPosition
Placement of the label of a LimitLine. For a horizontal line on a y-axis, LEFT and RIGHT pick the end of the line and TOP and BOTTOM the side of it. For a vertical line on an x-axis, LEFT and RIGHT pick the side of the line and TOP and BOTTOM the end.
LineDataSetMode
How the segments between entries of a LineDataSet are drawn.
PaintAlign
Where the x position of drawText sits on the text, like Paint.Align.
PaintStyle
How a shape is painted, like Paint.Style.
Rounding
How DataSet.getEntryIndex picks an entry when no entry has exactly the requested x.
ScatterShape
Built-in shapes a scatter data set can be drawn with. Setting one on the data set picks its renderer.
ValuePosition
Where a slice's label or value is drawn.
XAxisPosition
Placement of the x-axis labels: TOP above the content area, BOTTOM below it, BOTH_SIDED above and below, TOP_INSIDE and BOTTOM_INSIDE inside the content area along its top or bottom edge.
YAxisLabelPosition
Placement of the y-axis labels: OUTSIDE_CHART next to the content area, INSIDE_CHART over it.

Extensions

ChartCanvas on Canvas
The android.graphics.Canvas calls of the renderers, drawing with a ChartPaint.

Functions

dashPath(Path source, DashPathEffect effect) → Path
Returns the dashes of source for effect, with the semantics of Skia's dash path effect behind Android's DashPathEffect.

Typedefs

EasingFunction = double Function(double input)
An easing curve: maps progress 0..1 to a value that is 0 at 0 and 1 at 1.