Manual
Overview
Language
IntroductionScenes & structureText & inlineGraphsCode panesAnimationDataReuse & logicExpressions & parameters
Elements
Text
ParagraphHeading 1Heading 2Heading 3Heading 4Unordered ListDivider
Media
ImageTableEquation
Callouts
NoteDefinitionExampleTask
Graph
GraphLinePolygonCurveIntegralScatterHistogramPointSegmentVectorCircleSquareRectangleTriangleStarDiamondHexagonTextAxis labelAxis BraceFitResidualsContourHeatmapParameter
Code
Code canvasLines
Animation
CueDraw cueTrace cueHighlight cueSpotlight cueType cue
Structure
SceneStep
Reference
Internote Reference
Inline
Formatting
BoldItalicsInline CodeHighlightLink
Text colour
Red textOrange textYellow textGreen textTeal textBlue textPurple textPink textGrey text
Maths
Maths
Reference
Internote ReferenceValueConstant
Other
FootnoteIcon
Directives
DatasetIncludeConstantsTemplatePresetConditionalForIgnore
Keyframes
KeyframeZoom keyframe
Attribute types
?
  1. Elements
  2. Graph
  3. Line

Line

lineBlock elementGraph

A path through a list of points. `interpolate: step` holds each value until the next x and then jumps — a staircase, which is what a cumulative distribution, a tally, or a price that only changes on the hour actually looks like — and draws the dots at each jump: filled where the function lands, hollow where it left.

Attributes

dataRequiredImplicit
parametised-coordinate-list
Also written: pointsThe readings, as coordinate pairs.The head shorthand supplies it: line:value
colour
colour
Also written: colorThe line.
Defaultpink
width
parametised-number
Stroke width.
Default2
interpolate
interpolation
Also written: interpolationHow it gets from one reading to the next: `linear` joins them, `step` holds and jumps.
Defaultlinear
endpoints
boolean
Also written: dotsOn a step, the dots at each jump — filled where the value is taken, hollow where it is not.
Defaulttrue
risers
boolean
Also written: connectOn a step, the vertical joins between treads. Off by default: a function has one value at each x.
Defaultfalse
label
rich-text
Text drawn beside the line — rich text.
hidden
boolean
Declared and framed, but not drawn.
Defaultfalse
lock
boolean
Also written: lockedA reader may not edit it on an editable graph.
Defaultfalse
text-size
number
Size of the label.
Default20
z
parametised-number
Draw order within the pane.

Allowed in

canvas.graph { }cue { }cue.draw { }cue.trace { }cue.highlight { }cue.spotlight { }

Examples

line(data: (0, 0), (2, 2), (4, 1); colour: pink)
line(data: (0, 0), (1, 0.5), (2, 1); interpolate: step)
line(data: (0, 0), (1, 0.5), (2, 1); interpolate: step; risers: true; endpoints: false)
On this page
AttributesAllowed inExamples
Line · Internote