ChartPainterBase class abstract

Inheritance
Implementers

Constructors

ChartPainterBase({Listenable? repaint, ChartTheme theme = ChartTheme.light})
Repaint listenable — pass a ChartController or AnimationController.
const

Properties

axisPaint Paint
no setter
colorCache ColorCache
no setter
crosshairPaint Paint
no setter
gridPaint Paint
no setter
hashCode int
The hash code for this object.
no setterinherited
paintCache PaintCache
no setter
pathCache PathCache
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticsBuilder SemanticsBuilderCallback?
Returns a function that builds semantic information for the picture drawn by this painter.
no setterinherited
textPainterCache TextPainterCache
no setter
theme ChartTheme
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be notified when it is time to repaint.
inherited
buildAndCachePath(String key, Path builder()) Path
Build (or retrieve cached) a ui.Path keyed by key.
clipToViewport(Canvas canvas, ChartViewport viewport, void body()) → void
Clip canvas to the viewport plot area for the duration of body.
drawCrosshair(Canvas canvas, ChartViewport viewport, double cx) → void
Draw a vertical crosshair line at canvas-x cx.
drawDashedLine(Canvas canvas, Offset start, Offset end, Paint paint, {double dash = 6, double gap = 4}) → void
Draw a dashed line segment with paint.
drawHorizontalCrosshair(Canvas canvas, ChartViewport viewport, double cy) → void
Draw a horizontal crosshair line at canvas-y cy.
drawHorizontalGrid(Canvas canvas, ChartViewport viewport, List<double> yTicks, {bool dashed = true}) → void
Draw horizontal grid lines across viewport for yTicks.
drawTooltip(Canvas canvas, Size canvasSize, Offset anchor, List<String> lines) → void
Draw a rounded-rect tooltip bubble.
drawVerticalGrid(Canvas canvas, ChartViewport viewport, List<double> xPositions, {bool dashed = false}) → void
Draw vertical grid lines for each x category in xPositions.
drawXAxisLabels(Canvas canvas, ChartViewport viewport, List<String> xLabels, List<double> xPositions) → void
Draw bottom X-axis labels for xLabels at xPositions.
drawXAxisLabelsRotated(Canvas canvas, ChartViewport viewport, List<String> xLabels, List<double> xPositions, {double angleDeg = -45}) → void
Draw rotated X-axis labels (e.g., for many categories).
drawYAxisLabels(Canvas canvas, ChartViewport viewport, List<double> yTicks, String formatter(double)) → void
Draw left Y-axis labels for yTicks.
fillPaint(Color color) Paint
fillPaintMutable(Color color) Paint
Returns a new mutable fill paint — safe to add shaders, maskFilters etc.
hitTest(Offset position) bool?
Called whenever a hit test is being performed on an object that is using this custom paint delegate.
inherited
invalidatePath(String key) → void
invalidatePathsWithPrefix(String prefix) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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.
inherited
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
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 ChartPainterBase old) bool
Subclasses should override shouldRepaintChart instead.
override
shouldRepaintChart(covariant ChartPainterBase old) bool
Return true if chart-specific state (data, selection, animation value…) has changed. Keep this as cheap as possible — reference equality is fine.
strokePaint(Color color, double width) Paint
toString() String
A string representation of this object.
inherited

Operators

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