TargetAreaDecoration class

Target area decoration, draw a RRect on the chart as target range To actually change item colors you have to also set colorOverTarget

Target range is defined by targetMin and targetMax

Inheritance

Constructors

TargetAreaDecoration({required double targetMin, required double targetMax, bool isTargetInclusive = true, List<double>? dashArray, double lineWidth = 2.0, Color targetLineColor = Colors.red, Color colorOverTarget = Colors.red, EdgeInsets areaPadding = EdgeInsets.zero, BorderRadius? targetAreaRadius, Color? targetAreaFillColor})
Constructor for target area

Properties

areaPadding EdgeInsets
Padding for target area
final
colorOverTarget Color
Color item should take once target is missed
final
dashArray List<double>?
Dash pattern for the line, if left empty line will be solid
final
hashCode int
The hash code for this object.
no setterinherited
isTargetInclusive bool
In case you want to change how value acts on the target value by default this is true, meaning that when the target is the same as the value then the value and it's not using colorOverTarget
final
lineWidth double
Width of the target area border
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
targetAreaFillColor Color?
Fill color for TargetAreaDecoration
final
targetAreaRadius BorderRadius?
Border radius for TargetAreaDecoration
final
targetLineColor Color
Color for target border
final
targetMax double
Max target value for the area
final
targetMin double
Min target value for the area
final

Methods

animateTo(DecorationPainter endValue, double t) TargetAreaDecoration
Animate to next decoration state, each decoration should implement this. This is just regular lerp function, but instead of static function where you pass start and end state, here we start with current state and animate to endValue.
override
applyPaintTransform(ChartState state, Size size) Offset
override
draw(Canvas canvas, Size size, ChartState state) → void
Draw decoration. Decoration can be foreground or background decoration that will be drawn on the chart decorations can ignore padding and can use whole available canvas to draw.
override
getRenderer(ChartState state) Widget
inherited
getTargetItemColor(Color defaultColor, ChartItem item) Color
Return ColorForValue set up to pair with this decoration
initDecoration(ChartState state) → void
Init decoration is first thing called on decorations, it will pass current ChartState so decoration can easily calculate needed stuff for their layout.
inherited
isSameType(DecorationPainter other) bool
Used for animating, we just need to find matching type, don't actually check for equality since we want to animate from one state to other. Some decorations may consider overriding this in case multiples are used
inherited
layoutSize(BoxConstraints constraints, ChartState state) Size
override
marginNeeded() EdgeInsets
Get extra margin (not definable by the user). This makes sure that any decoration that leaves original drawing window is not drawing outside of that window (This is not enforced right now but it's unwanted behaviour)
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paddingNeeded() EdgeInsets
Get extra padding (not definable by user, calculated by decoration if needed). This makes sure that decoration will fit with the chart in wanted area.
inherited
toString() String
A string representation of this object.
inherited

Operators

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