<xLabel>
<xLabel> is a Graphical
component that specifies a label for the horizontal axis on a <graph>.
Attributes and Properties
Attributes for <xLabel>
Positioning (2)
anchorpoint. Default value: . Coordinates of the anchor point used to position this component on a graph.
positionFromAnchorkeyword. Where this component sits relative to its anchor point.
| Value | Description |
|---|---|
upperRight | Place the component above and to the right of the anchor point. |
upperLeft | Place the component above and to the left of the anchor point. |
lowerRight | Place the component below and to the right of the anchor point. |
lowerLeft | Place the component below and to the left of the anchor point. |
top | Place the component directly above the anchor point. |
bottom | Place the component directly below the anchor point. |
left | Place the component directly to the left of the anchor point. |
right | Place the component directly to the right of the anchor point. |
center (default) | Center the component on the anchor point. |
Other (5)
draggableboolean. Default value: true. Whether the label can be dragged on a graph.
forreference. Reference to the component this label is for (e.g., an input).
forObjectreference. Reference to the graphical object this label is attached to.
layernumber. Default value: 0. Z-order layer index when shown on a graph.
maskLabelboolean. Default value: false. Whether to give the label an opaque background so it stays legible when it overlaps an axis, grid line, or another object.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <xLabel name="x">
Positioning (2)
$x.anchorpoint. The coordinates where this component is anchored on the graph.
$x.positionFromAnchortext. Where this component sits relative to its anchor point.
Other (14)
$x.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$x.disabledboolean. Whether this component is disabled and cannot be interacted with.
$x.draggableboolean. Whether the label can be dragged on a graph.
$x.fixedboolean. Whether this component's value is fixed and cannot be modified.
$x.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$x.hasLatexboolean. Whether the label contains LaTeX content.
$x.latexlatex. The label's content as a LaTeX string.
$x.layernumber. Z-order layer index when shown on a graph.
$x.maskLabelboolean. Whether to give the label an opaque background so it stays legible when it overlaps an axis, grid line, or another object.
$x.texttext. The label's text content.
$x.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$x.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
$x.valuexLabel. The label's content as a label-typed value.
Common to all components (4)
$x.doenetMLtext. The DoenetML source code that produced this component.
$x.hideboolean. Whether to hide this component from the rendered output.
$x.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$x.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <xLabel> on a <graph>
The <xLabel> component is a child of a <graph>. An <xLabel>
can contain text, inline display mathematics (<m>) or <math> components.
Example: <xLabel> on left side
To change the default right-side position of
the <xLabel> to the left side, apply the xLabelPosition
attribute within the <graph> definition.