ChartPainter<T extends ChartData<IDataSet<Entry>>> class

Inheritance
Implemented types
Implementers

Constructors

ChartPainter(T data, Animator animator, ViewPortHandler viewPortHandler, double maxHighlightDistance, bool highLightPerTapEnabled, double extraLeftOffset, double extraTopOffset, double extraRightOffset, double extraBottomOffset, IMarker marker, Description desc, bool drawMarkers, Color infoBgColor, TextPainter infoPainter, TextPainter descPainter, XAxis xAxis, Legend legend, LegendRenderer legendRenderer, DataRendererSettingFunction rendererSettingFunction, OnChartValueSelectedListener selectedListener)

Properties

animator Animator
read-only
extraBottomOffset double
read-only
extraLeftOffset double
read-only
extraRightOffset double
read-only
extraTopOffset double
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
highlighter IHighlighter
read / write
highLightPerTapEnabled bool
read-only
indicesToHighlight List<Highlight>
read-only
isDrawMarkers bool
read-only
legend Legend
read-only
legendRenderer LegendRenderer
read-only
marker IMarker
read-only
renderer DataRenderer
///////////////////////////////////////////// object responsible for rendering the data
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
semanticsBuilder SemanticsBuilderCallback
Returns a function that builds semantic information for the picture drawn by this painter. [...]
read-only, inherited
size Size
read-only
viewPortHandler ViewPortHandler
read-only
xAxis XAxis
read-only

Methods

addListener(VoidCallback listener) → void
Register a closure to be notified when it is time to repaint. [...]
inherited
calcMinMax() → void
Calculates the y-min and y-max value and the y-delta and x-delta value
calculateOffsets() → void
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
drawDescription(Canvas c, Size size) → void
Draws the description text in the bottom right corner of the chart (per default)
drawMarkers(Canvas canvas) → void
draws all MarkerViews on the highlighted positions
getCenter(Size size) MPPointF
Returns a recyclable MPPointF instance. Returns the center point of the chart (the whole View) in pixels. [...]
override
getCenterOffsets() MPPointF
Returns a recyclable MPPointF instance. Returns the center of the chart taking offsets under consideration. (returns the center of the content rectangle) [...]
override
getData() ChartData<IDataSet<Entry>>
override
getDefaultValueFormatter() ValueFormatter
override
getHighlightByTouchPoint(double x, double y) Highlight
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. [...]
getMarkerPosition(Highlight high) List<double>
Returns the actual position in pixels of the MarkerView for the given Highlight object. [...]
getMaxHighlightDistance() double
Returns the maximum distance in scren dp a touch can be away from an entry to cause it to get highlighted. [...]
override
getMaxVisibleCount() int
inherited
getMeasuredHeight() double
getMeasuredWidth() double
getYChartMax() double
Returns the maximum y value of the chart, regardless of zoom or translation. [...]
inherited
getYChartMin() double
Returns the minimum y value of the chart, regardless of zoom or translation. [...]
inherited
highlightValue1(double x, int dataSetIndex) → void
Highlights any y-value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. This method will call the listener. @param x The x-value to highlight @param dataSetIndex The dataset index to search in
highlightValue2(double x, double y, int dataSetIndex) → void
Highlights the value at the given x-value and y-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. This method will call the listener. @param x The x-value to highlight @param y The y-value to highlight. Supply NaN for "any" @param dataSetIndex The dataset index to search in
highlightValue3(double x, int dataSetIndex, bool callListener) → void
Highlights any y-value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. @param x The x-value to highlight @param dataSetIndex The dataset index to search in @param callListener Should the listener be called for this change
highlightValue4(double x, double y, int dataSetIndex, bool callListener) → void
Highlights any y-value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. @param x The x-value to highlight @param y The y-value to highlight. Supply NaN for "any" @param dataSetIndex The dataset index to search in @param callListener Should the listener be called for this change
highlightValue5(Highlight highlight) → void
Highlights the values represented by the provided Highlight object This method will not call the listener. [...]
highlightValue6(Highlight high, bool callListener) → void
Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener. [...]
highlightValues(List<Highlight> highs) → void
Highlights the values at the given indices in the given DataSets. Provide null or an empty array to undo all highlighting. This should be used to programmatically highlight values. This method will not call the listener. [...]
hitTest(Offset position) bool
Called whenever a hit test is being performed on an object that is using this custom paint delegate. [...]
inherited
init() → void
initDefaultNormal() → void
initDefaultWithData() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onPaint(Canvas canvas, Size size) → void
paint(Canvas canvas, Size size) → void
Called whenever the object needs to paint. The given Canvas has its coordinate space configured such that the origin is at the top left of the box. The area of the box is the size of the size argument. [...]
override
reassemble() → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies when it is time to repaint. [...]
inherited
selectedValue(Highlight high) → void
shouldRebuildSemantics(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former). [...]
inherited
shouldRepaint(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former). [...]
override
toString() String
Returns a string representation of this object.
inherited
valuesToHighlight() bool
Returns true if there are values to highlight, false if there are no values to highlight. Checks if the highlight array is null, has a length of zero or if the first object is null. [...]

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited