xychart

.xychart lines:{Boolean = true}
bars:{Boolean = false}
x:{String? = null}
xrange:{Range? = null}
xtags:{Iterable<Any>? = null}
y:{String? = null}
yrange:{Range? = null}
caption:{String? = null}
values:{Iterable<Any>}
-> Node

Creates a chart diagram on the XY plane.

The following example plots 4 points at (1, 5), (2, 2), (3, 4), (4, 10), connected by a line:

.xychart
- 5
- 2
- 4
- 10

Multiple lines can be plotted by supplying a list of lists of points. Each list will be plotted as a separate line:

.xychart
- |
- 5
- 8
- 3
- |
- 3
- 5
- 10
- |
- 8
- 3
- 5

Return

the generated diagram node

Parameters

lines

whether to draw lines

bars

whether to draw bars

x

optional label for the X axis

xrange

optional range for the X axis. If open-ended, the range will be set to the minimum and maximum values of the X values. Incompatible with xtags.

xtags

optional categorical tags for the X axis. Incompatible with xrange.

y

optional label for the Y axis

yrange

optional range for the Y axis. If open-ended, the range will be set to the minimum and maximum values of the Y values

caption

optional caption. If a caption is present, the diagram will be numbered as a figure.

values

the Y values to plot. They can be a list of points, which will be plotted as a single line, or a list of lists of points, which will be plotted as multiple lines.

Throws

if both xrange and xtags are set