XYGrid constructor
Constructs a grid consisting of lines of length xLength
and yLength
,
in pixels, parallel to x and y, respectively.
xValues
and yValues
define the x and y positions of the grid lines in
pixels relative to their container gridContainer.
xValues.length
and yValues.length
define the number of
grid lines parallel to y and x, respectively. If xValues
is null or
empty no lines parallel to y will be drawn.
If yValues
is null or empty no lines parallel to x will be drawn.
gridAttr
: If null, GRID_DEFAULT_ATTRIBUTES are used. Otherwise
you can define here colors, dashes and more. The attributes specified here
override the respective defaults.
Implementation
XYGrid(this.xValues, this.yValues, this.xLength, this.yLength,
Map<AxA, String> gridAttr) {
attributes = new Map.from(GRID_DEFAULT_ATTRIBUTES); // init. attributes
if (gridAttr != null) {
// possibly changed attributes as wished by caller
attributes.addAll(gridAttr);
}
buildActiveGrid(); // arbitrary initial pos.
}