Share JSXGraph: example "Axis labels"

JSXGraph
Share JSXGraph: example "Axis labels"
This website is a beta version. The official release will be in **2024**.

Axis labels

For long label texts for the axes it is advisable to use the attributes `anchorX` and `anchorY` to ensure that the labels are visible.
// Define the id of your board in BOARDID

const board = JXG.JSXGraph.initBoard(BOARDID, {
    boundingbox: [-5, 5, 5, -5],
    axis: true,
    defaultAxes: {
        x: {
            name: 'Distance (km)',
            withLabel: true,
            label: {
                position: 'rt',
                offset: [-5, 15],
                anchorX: 'right'
            }
        },
        y: {
            withLabel: true,
            name: 'Y',
            label: {
                position: 'rt',
                offset: [-20, -5],
                anchorY: 'top'
            }
        }
    }
});