StackableValuePoint class

Represents one Y numeric value in the ChartData.dataRows, with added information about the X coordinate (display coordinate).

Instances are stacked if isStacked is true.

The members can be grouped in three groups.

  1. The xLabel, dataRowIndex and predecessorPoint are initial variables along with dataY.

  2. The fromY and toY and dataY are data-values representing this point's numeric value. This group's members do NOT change under applyParentOffset as they represent data, not coordinates; they must not change with container (display) size change.

  • In addition, the fromY and toY are stacked, dataY is NOT stacked. Stacking is achieved by adding the values of dataY from the bottom of the stacked values to this point, by calling the stackOnAnother method.
  1. The scaledX, scaledY, scaledFromY, scaledToY, are scaled-coordinates - represent members from group 2, scaled to the container coordinates (display coordinates). This group's members DO change under applyParentOffset as they represent coordinates.

Stacking management:

  • This object does not manage it's stacking, stacking is delegated to the container that manages this object along with values before (below) and after (above). The managing object is PointsColumn.

Constructors

StackableValuePoint({required String xLabel, required double dataY, required int dataRowIndex, StackableValuePoint? predecessorPoint})
The generative constructor of objects for this class.
StackableValuePoint.initial()
Initial instance of a StackableValuePoint. Forwarded to the generative constructor. This should fail if it undergoes any processing such as layout

Properties

dataRowIndex int
The index of this point in the PointsColumn containing this point in it's PointsColumn.stackableValuePoints list.
getter/setter pair
dataY double
The transformed but NOT stacked Y data value. ANY dataYs are 1. transformed, then 2. potentially stacked IN PLACE, then 3. potentially scaled IN A COPY!!
getter/setter pair
fromY double
The stacked-data-value where this point's Y value starts. Created, along with toY as follows:
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isStacked bool
True if data are stacked.
getter/setter pair
predecessorPoint StackableValuePoint?
The predecessor point in the PointsColumn containing this point in it's PointsColumn.stackableValuePoints list.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaledFrom Offset
The scaledFrom and scaledTo are the scaled Offsets for painting in absolute chart coordinates. More precisely, offsets of the bottom and top of the presenter of this point - for example, for VerticalBar, bottom left and top right of each bar representing this value point (data point). Wrapper for scaledX, scaledFromY
getter/setter pair
scaledFromY double
The position in the top container, representing the scaled value of fromY. Initially created as yLabelsCreator.scaleY(value: fromY), then moved by offsetting by applyParentOffset.
getter/setter pair
scaledTo Offset
Wrapper for scaledX, scaledToY
getter/setter pair
scaledToY double
The position in the top container, representing the scaled value of toY. Initially created as yAxisdY = yLabelsCreator.scaleY(value: toY);, then moved by offsetting by applyParentOffset.
getter/setter pair
scaledX double
The position in the topContainer, through the PointsColumns hierarchy. Not actually scaled (because it does not represent any X data), just always moved by offsetting by applyParentOffset.
getter/setter pair
scaledY double
The position in the topContainer, representing the scaled value of dataY. Initially scaled to available pixels on the Y axis, then moved by offsetting by applyParentOffset.
getter/setter pair
toY double
The stacked-data-value where this point's Y value ends. See fromY for details.
getter/setter pair
xLabel String
getter/setter pair

Methods

applyParentOffset(Offset offset) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scale({required double scaledX, required YLabelsCreatorAndPositioner yLabelsCreator}) StackableValuePoint
Scales this point to the container coordinates (display coordinates).
stack() StackableValuePoint
stackOnAnother(StackableValuePoint? predecessorPoint) StackableValuePoint
Stacks this point on top of the passed predecessorPoint.
toString() String
A string representation of this object.
inherited
unstackedClone() StackableValuePoint
Copy - clone of this object unstacked. Does not allow to clone if already stacked.

Operators

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