YLabelsCreatorAndPositioner class
Creates, scales, and formats the Y labels, from the transformed data to their positions and formatted strings on the Y axis.
The following members are most relevant in the creating and formatting labels
_dataYs
is a list of numeric Y values, passed to constructor. An envelope is created from_dataYs
, possibly extending the closure interval to start or end at 0.- Ex1. for
_dataYs
-600.0 .... 2200.0
==> dataYsEnvelope =-600.0, 2200.0
- Ex2. for
_dataYs
600.0 .... 1800.0
==> dataYsEnvelope =0.0, 1800.0
- Ex1. for
axisY
is the interval of the Y axis coordinates. e.g.8.0, 400.0
- yUserLabels may be set by user.
- labelInfos are labels calculated to represent numeric Y values, ONLY in their highest order.
- Ex1. labelInfos ==>
-1000, 0, 1000, 2000
(NOT ending at 2200) - Ex2. labelInfos ==>
0, 1000, 2000
From the members dataYsEnvelope and labelInfos, the_mergedLabelYsIntervalWithDataYsEnvelope
are calculated. The result serves as the '(transformed) data range'. All (transformed) data and labels are located inside the_mergedLabelYsIntervalWithDataYsEnvelope
- Ex1. labelInfos ==>
- Ex1. for dataYsEnvelope=
-600.0, 2200.0
and labelInfos=-1000, 0, 1000, 2000
==> merged=-1000, 0, 1000, 2200
- Ex2. for dataYsEnvelope=
0.0, 1800.0
and labelInfos=0, 1000, 2000
==> merged=0, 1000, 2000
Constructors
-
YLabelsCreatorAndPositioner({required List<
double> dataYs, required Interval axisY, required ChartBehavior chartBehavior, required Function valueToLabel, required Function yInverseTransform, List<String> ? yUserLabels}) - Generative constructor allows to create labels.
Properties
- dataYsEnvelope ↔ Interval
-
The dataYsEnvelope is created from the input
_dataYs
as it's closure interval, possibly extended to start at 0.latefinal -
dataYsOfLabels
→ List<
double> -
Extracts not-scaled && transformed values where labels from labelInfos are positioned.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
labelInfos
↔ List<
LabelInfo> -
Maintains labels created from data values, scaled and unscaled.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
yUserLabels
↔ List<
String> ? -
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scaleY(
{required double value}) → double -
Scales
value
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited