An x and a y axis out of one origin, with labels and an optional series. More...
| Import Statement: | import Clayground.Canvas |
Axes draws two arrow-headed axes from a common origin, a label at the end of each, and an optional series of points on them. Everything is placed in world units, so the axes pan and zoom with the canvas like any other canvas item.
With progress below 1 the parts draw themselves in order: x axis, y axis, x label, y label, series - each part priced by the ink it costs, so a progress of 0.5 is half the drawing and not the third part of five.
Example usage:
import Clayground.Canvas as Canv Canv.Axes { canvas: myCanvas xWu: 1; yWu: 1 widthWu: 5; heightWu: 3 xLabel: "Ib"; yLabel: "Ic" series: [{x: 1.4, y: 1.2}, {x: 3.0, y: 2.0}, {x: 5.5, y: 3.4}] sketch: "chalk" strokeColor: "#f1efe6" }
The parent canvas for coordinate transformation. Required.
X position of the origin in world units.
Y position of the origin in world units.
Length of the x axis in world units.
Length of the y axis in world units.
Label drawn at the end of the x axis.
Label drawn at the end of the y axis.
Font size of the labels in world units. Default is 0.4.
Array of points {x, y} in world units drawn as a polyline on the axes. Empty by default.
Color of the axes and the labels. Default is black.
Width of the axis lines in pixels. Default is 2.
Color of the series line. Defaults to strokeColor.
Width of the series line in pixels. Defaults to strokeWidth.
Length of an axis arrow head in pixels, 4 * strokeWidth + 4 by default.
Pen used for the axes, labels and series: "none" (default), "chalk" or "marker", as on Poly.
How much of the drawing is done, from 0 to 1 (default 1), spent in the order x axis, y axis, x label, y label, series.
Which wobble the sketch pens use (default 0).
The five part fractions at the current progress, in the order x axis, y axis, x label, y label, series.