ReferenceyLabel

<yLabel>

A label for the y-axis of a graph

<yLabel> is a Graphical component that specifies a label for the vertical axis on a <graph>.

Attributes and Properties

Attributes for <yLabel>

Positioning (2)
anchor

point. Default value: \(\left( 0, 0 \right)\). Coordinates of the anchor point used to position this component on a graph.

positionFromAnchor

keyword. Where this component sits relative to its anchor point.

ValueDescription
upperRightPlace the component above and to the right of the anchor point.
upperLeftPlace the component above and to the left of the anchor point.
lowerRightPlace the component below and to the right of the anchor point.
lowerLeftPlace the component below and to the left of the anchor point.
topPlace the component directly above the anchor point.
bottomPlace the component directly below the anchor point.
leftPlace the component directly to the left of the anchor point.
rightPlace the component directly to the right of the anchor point.
center (default)Center the component on the anchor point.
Other (4)
draggable

boolean. Default value: true. Whether the label can be dragged on a graph.

for

reference. Reference to the component this label is for (e.g., an input).

forObject

reference. Reference to the graphical object this label is attached to.

layer

number. Default value: 0. Z-order layer index when shown on a graph.

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <yLabel name="y">

Positioning (2)
$y.anchor

point. The coordinates where this component is anchored on the graph.

$y.positionFromAnchor

text. Where this component sits relative to its anchor point.

Other (13)
$y.backgroundColor

text. Human-readable name for this component's background color, derived from the active style and theme.

$y.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$y.draggable

boolean. Whether the label can be dragged on a graph.

$y.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$y.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$y.hasLatex

boolean. Whether the label contains LaTeX content.

$y.hidden

boolean. Whether this component is hidden from the rendered output.

$y.latex

latex. The label's content as a LaTeX string.

$y.layer

number. Z-order layer index when shown on a graph.

$y.text

text. The label's text content.

$y.textColor

text. Human-readable name for this component's text color, derived from the active style and theme.

$y.textStyleDescription

text. Human-readable description of this component's text styling (color and any background color).

$y.value

yLabel. The label's content as a label-typed value.

Common to all components (4)
$y.doenetML

text. The DoenetML source code that produced this component.

$y.hide

boolean. Whether to hide this component from the rendered output.

$y.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$y.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: <yLabel> on a <graph>

The <yLabel> component is a child of a <graph>. A <yLabel> can contain text, inline display mathematics (<m>) or <math> components.


Example: <yLabel> on bottom of <graph>

To change the default top position of the <yLabel> to the bottom, apply the yLabelPosition attribute within the <graph> definition.


Example: Change default <yLabel> alignment

Use the yLabelAlignment attribute within the <graph> definition to choose between a left alignment and a right alignment for the <yLabel>. The default position is left, which means the label appears to the left of the vertical axis.