dv_annotation library

Annotation overlays for charts.

Classes

Annotation
Base class for chart annotations.
AnnotationConfig
Base configuration for annotations.
AreaAnnotation
A reference area annotation spanning a range of data values.
AreaAnnotationConfig
Configuration for area annotations.
LabelAnnotation
A text label annotation at a specific position.
LabelAnnotationConfig
Configuration for label annotations.
LineAnnotation
A reference line annotation at a specific data value.
LineAnnotationConfig
Configuration for line annotations.
PixelLabelAnnotation
A simple label annotation positioned by pixel coordinates.

Enums

AnnotationOrientation
The orientation of an annotation.
LabelAnchor
Anchor point for positioning the label relative to its coordinates.

Functions

areaAnnotation({Key? key, required dynamic scale, required dynamic startValue, required dynamic endValue, required double width, required double height, AreaAnnotationConfig config = const AreaAnnotationConfig(), String? label, TextStyle? labelStyle, Alignment labelAlignment = Alignment.center}) Widget
Creates an AreaAnnotation widget.
drawAnnotationLine(Canvas canvas, Offset start, Offset end, Paint paint, List<double>? dashPattern) → void
Helper to draw a dashed line on a canvas.
horizontalBand({Key? key, required dynamic scale, required dynamic startValue, required dynamic endValue, required double width, required double height, Color fillColor = const Color(0xFF666666), double fillOpacity = 0.2, bool showBorder = false, String? label, TextStyle? labelStyle}) Widget
Creates a horizontal area annotation (band).
horizontalLineAnnotation({Key? key, required dynamic scale, required dynamic value, required double width, required double height, Color color = const Color(0xFF666666), double strokeWidth = 1, List<double>? dashPattern, String? label, TextStyle? labelStyle}) Widget
Creates a horizontal line annotation.
labelAnnotation({Key? key, required dynamic xScale, required dynamic yScale, required dynamic xValue, required dynamic yValue, required String label, TextStyle? labelStyle, required double width, required double height, LabelAnnotationConfig config = const LabelAnnotationConfig(), LabelAnchor anchor = LabelAnchor.center, Offset offset = Offset.zero}) Widget
Creates a LabelAnnotation widget.
lineAnnotation({Key? key, required dynamic scale, required dynamic value, required double width, required double height, LineAnnotationConfig config = const LineAnnotationConfig(), String? label, TextStyle? labelStyle, Offset labelOffset = const Offset(4, -4)}) Widget
Creates a LineAnnotation widget.
verticalBand({Key? key, required dynamic scale, required dynamic startValue, required dynamic endValue, required double width, required double height, Color fillColor = const Color(0xFF666666), double fillOpacity = 0.2, bool showBorder = false, String? label, TextStyle? labelStyle}) Widget
Creates a vertical area annotation (band).
verticalLineAnnotation({Key? key, required dynamic scale, required dynamic value, required double width, required double height, Color color = const Color(0xFF666666), double strokeWidth = 1, List<double>? dashPattern, String? label, TextStyle? labelStyle}) Widget
Creates a vertical line annotation.