ChartViewport class
Translates between data coordinates and canvas pixels.
Constructors
- ChartViewport({required double left, required double top, required double right, required double bottom, required double dataMinX, required double dataMaxX, required double dataMinY, required double dataMaxY})
-
const
- ChartViewport.fromSize(Size size, ChartSpacing spacing, {required double dataMinX, required double dataMaxX, required double dataMinY, required double dataMaxY})
-
Create a viewport from canvas
sizeand data range with padding from ChartSpacing.factory
Properties
- bottom → double
-
final
- dataMaxX → double
-
final
- dataMaxY → double
-
final
- dataMinX → double
-
final
- dataMinY → double
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
no setter
- left → double
-
final
- rect → Rect
-
The canvas Rect corresponding to the plot area.
no setter
- right → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → double
-
final
- width → double
-
no setter
Methods
-
containsCanvas(
Offset pt, {double padding = 0}) → bool - True if the canvas point is within the plot area (with optional padding).
-
isDataXVisible(
double dataX) → bool - True if a data x-value would land in the visible canvas range.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCanvas(
double dataX, double dataY) → Offset -
toCanvasX(
double dataX) → double -
toCanvasY(
double dataY) → double -
toDataX(
double canvasX) → double -
toDataY(
double canvasY) → double -
toString(
) → String -
A string representation of this object.
inherited
-
visibleIndexRange(
int totalPoints) → (int, int) - Range of data indices that map to the visible canvas area.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited