BarEntry<D> class
Entry for a bar chart. A bar is either a single value in y or a stack of values in stackValues.
D is the type of the payload stored in data. Kotlin's positional constructors and its payload-less
BarEntry(x, y, icon) / BarEntry(x, stackValues, icon) factories are the named constructors BarEntry.new and
BarEntry.stacked, with data optional.
Constructors
- BarEntry({required double x, required double y, ChartDrawable? icon, D? data})
-
Creates a single, unstacked bar at
x(position on the x axis in value space) with heighty, an optionalicondrawn at the entry when icons are enabled and an optionaldatapayload. -
BarEntry.stacked({required double x, required List<
double> stackValues, ChartDrawable? icon, D? data}) -
Creates a stacked bar at
xwhose y is the sum ofstackValues, the stack values bottom to top, with an optionalicondrawn at the entry when icons are enabled and an optionaldatapayload for the whole stack.
Properties
- data → D?
-
Optional payload carried with the entry, for example the object the entry was made from.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon ↔ ChartDrawable?
-
Drawable drawn at the entry's position when the data set has icons enabled, or null for none.
getter/setter pairinherited
- isStacked → bool
-
True when this entry holds stack values, even if the stack has only one value.
no setter
- negativeSum → double
-
Sum of the absolute values of all negative stack values, so a positive number. 0 for a single bar.
no setter
- positiveSum → double
-
Sum of all positive stack values. 0 for a single bar.
no setter
-
ranges
→ List<
Range> ? -
Start and end on the y axis of each stack value, in the order of stackValues. Positive values stack
upwards from zero, negative values downwards. Null until stack values have been set.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stackValues
↔ List<
double> ? -
Values of a stacked bar, drawn bottom to top in list order, or null for a single bar.
Assigning them sets y to their sum and recomputes positiveSum, negativeSum and ranges.
getter/setter pair
- x ↔ double
-
Position on the x axis in value space (not an index).
getter/setter pairinherited
- y ↔ double
-
The y value in value space; for pie and radar entries this is the entry's value.
getter/setter pairinherited
Methods
-
copy(
) → BarEntry< D> -
Returns a new entry with the same values. The stack list, icon and payload are shared, not copied.
override
-
equalTo(
Entry? e) → bool -
Compares x and y within Utils.FLOAT_EPSILON and requires the same payload instance.
Unlike
==, two separately created entries with the same values are considered equal.inherited -
getSumBelow(
int stackIndex) → double -
Sums the stack values that come after
stackIndexin stackValues. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited