LineData
chartjs: LineData
One dataset of a line chart.
A LineChart holds a LineData object for each of its
datasets, whose properties set how Chart.js draws it.
Each property is documented on its own, as in help LineData.data.
See also: LineChart, Color, Fill
Source Code: LineData
The LineData class contains the following properties:
A Color object defining the fill color of the lines between data
points. Default is empty, in which case a color is assigned
automatically by the Chart.js library.
A character vector, which can be either 'butt' (default),
'round', or 'square'. When 'butt', the ends of
lines are squared off at the endpoints. When 'round', the ends
of lines are rounded. When 'square' is set, the ends of lines
are squared off by adding a box with an equal width and half the height
of the line’s thickness.
A Color object defining the color of the lines between data
points. Default is empty, in which case a color is assigned
automatically by the Chart.js library.
A numeric vector defining the length and spacing of dashes drawn instead of a line.
A numeric scalar defining the offset of dashes and spacing drawn instead of a line. Default is 0.
A character vector defining the line border join style. It can be either
'round', 'bevel', or 'miter'.
A numeric scalar value defining the width of the line in pixels. Default is 3.
A numeric scalar value defining the pixels to clip relative to the chart’s area. Positive value allows overflow, negative value clips that many pixels inside chartArea. Defaults to zero pixels.
A character vector defining the cubic interpolation mode. It can be
either 'default' or 'monotonic'.
A numeric vector assigned at construction of the LineData object.
It cannot be empty.
A boolean scalar defining whether to draw the active points of a dataset
over the other points of the dataset. It is true by default.
A Fill object defining how to fill the area under the line. Type
help Fill for more details on the available filling modes. By
default, no filling is applied.
A Color object defining the fill color of the lines between data
points, when the mouse hovers over it. Default is empty, in which case
the color is the same as in backgroundColor.
A character vector, which can be either 'butt', 'round',
or 'square', defining the cap style of the line when the mouse
hovers over it. Default is empty, in which case the cap style is the
same as in borderCapStyle.
A Color object defining the color of the lines between data
points, when the mouse hovers over it. Default is empty, in which case
the color is the same as in borderColor.
A numeric vector defining the length and spacing of dashes drawn instead
of a line, when the mouse hovers over them. Default is empty, in which
case the length and spacing of the dashes are the same as in
borderDash.
A numeric scalar defining the offset of dashes drawn instead of a line,
when the mouse hovers over them. Default is empty, in which case the
offset is the same as in borderDashOffset
A character vector defining the line border join style, when the mouse
hovers over it. Default is empty, in which case the line border join
style is the same as in borderJoinStyle
A numeric scalar value defining the width of the line in pixels, when the
mouse hovers over it. Default is empty, in which case the width is the
same as in borderWidth.
A character scalar defining the base axis of the dataset. It can be
either 'x' for horizontal lines or 'y' for horizontal
lines. Default is 'x'.
A character vector defining the label for the dataset which appears in
the legend and tooltips. Default is empty. A chart shows no legend when
none of its datasets has a label, and names a dataset without one by its
position, such as "Dataset 2", when another has one.
A numeric scalar defining the drawing order of the dataset. It also affects order for stacking, tooltip and legend. Default is 0.
A Color object defining the fill color for the data points.
Default is empty, in which case a color is assigned automatically by the
Chart.js library.
A Color object defining the border color for the data points.
Default is empty, in which case a color is assigned automatically by the
Chart.js library.
A numeric scalar value defining the width of the data point border in pixels. Default is 1.
A numeric scalar value defining the pixel size of the non-displayed point that reacts to mouse events. Default is 1.
A Color object defining the fill color for the data points, when
the mouse hovers over them. Default is empty, in which case the fill
color is the same as in pointBackgroundColor.
A Color object defining the border color for the data point, when
the mouse hovers over it. Default is empty, in which case the border
color is the same as in pointBorderColor.
A numeric scalar value defining the width of the data point border in pixels, when the mouse hovers over it. Default is 1.
A numeric scalar value defining the radius of the data point border in pixels, when the mouse hovers over it. Default is 4.
A numeric scalar value defining the radius of the data point border in pixels. Default is 3.
A numeric scalar value defining the rotation of the data point border in degrees. Default is 0.
A character vector or a boolean value defining the shape of the points of
the dataset. As a character vector, it can be any of the following
values: 'circle', 'cross', 'crossRot',
'dash', 'line', 'rect', 'rectRounded',
'rectRot', 'star', 'triangle', and
'none'. By default it is 'circle. As a boolean value,
true defaults to 'circle' and false defaults to
'none'.
Not supported at the moment: its value is not written to the chart.
A boolean scalar defining whether to draw the line for this dataset. It
is true by default.
A boolean scalar or a numeric scalar defining whether to create a break
in the line for null data. When true, lines will be
drawn between points with no or null data. When false, points
with null data will create a break in the line. It can also be a number
specifying the maximum gap length to span. The unit of the value depends
on the scale used.
A character vector defining the ID of the group to which the dataset belongs to.
A character vector or a boolean value defining the interpolation mode
between data points. As a character vector, it can be any of the
following values: 'before' for step-before interpolation,
'after' for step-after interpolation, and 'middle' for
step-middle interpolation. As a boolean value, true equals to
'before' and false, which is the default value,
corresponds to no step interpolation. If stepped value is set to
anything other than false, tension will be ignored.
A numeric scalar value defining the Bezier curve tension of the line. By default it is 0, which corresponds to drawing straight lines between data points. This option is ignored if monotone cubic interpolation is used.
Not supported at the moment: its value is not written to the chart.
Not supported at the moment: its value is not written to the chart.
The LineData class offers the following public methods:
LineData: obj = LineData (data)
obj = LineData (data) returns a LineData
object, in which data must be a nonempty numerical vector
containing the data points of a single dataset to be plotted on a line.
Constructing a LineData object always assigns the default
property values, which can later be modified using dot notation syntax.
LineData: json = jsonstring (obj)
LineData: json = jsonstring (obj, mixed)
jsonstring (obj) returns a character vector, json,
holding the dataset in JSON, as Chart.js reads it in the datasets
of a chart.
jsonstring (obj, mixed) also writes the dataset’s
chart type when mixed is true, as a chart mixing types
needs.