scale method
StackableValuePoint
scale({
- required double scaledX,
- required YLabelsCreatorAndPositioner yLabelsCreator,
Scales this point to the container coordinates (display coordinates).
More explicitly, scales the data-members of this point to the said coordinates.
See class documentation for which members are data-members and which are scaled-members.
Note that the x values are not really scaled, as object does not
manage the unscaled x
(it manages the corresponding label only).
For this reason, the scaledX
value must be provided explicitly.
The provided scaledX
value should be the
"within ChartPainter
absolute" x coordinate (generally the center
of the corresponding x label).
Implementation
// todo-01-morph : Calling this 'scale' is suspect - this does not do any X dimension scaling at all!
// Analyze the uses of the 'scale' term in the system, probably needs improvement.
StackableValuePoint scale({
required double scaledX,
required YLabelsCreatorAndPositioner yLabelsCreator,
}) {
this.scaledX = scaledX;
scaledY = yLabelsCreator.scaleY(value: dataY);
scaledFromY = yLabelsCreator.scaleY(value: fromY);
scaledToY = yLabelsCreator.scaleY(value: toY);
// todo-01-morph : Can we remove scaledX, scaledFromY, scaledX, scaledToY and only maintain these offsets???
scaledFrom = ui.Offset(scaledX, scaledFromY);
scaledTo = ui.Offset(scaledX, scaledToY);
return this;
}