MAIDR JavaScript API
    Preparing search index...

    A Chart.js scale (axis) configuration.

    interface ChartJsScale {
        title?: { text?: string; display?: boolean };
        type?: string;
        stacked?: boolean;
        reverse?: boolean;
        labels?: (string | number)[];
        time?: { unit?: string };
        axis?: "x" | "y";
        position?: string | Record<string, number>;
        stack?: string;
        stackWeight?: number;
    }
    Index

    Properties

    title?: { text?: string; display?: boolean }
    type?: string
    stacked?: boolean
    reverse?: boolean

    Whether the scale runs the other way (largest value at the origin end). A rank axis is the case that matters here: a bump chart reverses y so rank 1 sits at the top.

    Chart.js resolves a controller's own default back into chart.options, so this is populated even when the author never wrote it — which is how a matrix chart's y scale reads true off an otherwise bare config.

    labels?: (string | number)[]

    A category scale's domain, in the order it is drawn along the axis (before ChartJsScale.reverse is applied).

    time?: { unit?: string }

    Time-scale options; unit names what one step of the axis measures.

    axis?: "x" | "y"

    Which axis this scale belongs to; defaults from the scale id's first letter.

    position?: string | Record<string, number>

    Which chart edge the scale is placed against. Chart.js also accepts dynamic positions ('center' or an { [scaleId]: value } object), hence the loose type; only the static edge strings participate in axis stacking.

    stack?: string

    Axis-stacking group name (Chart.js >= 3.7). Scales of the same axis kind sharing a stack are laid out in separate, non-overlapping bands — the native Chart.js way to express stacked panels within one canvas.

    stackWeight?: number

    Relative size of this scale's band within its axis stack.