MAIDR JavaScript API
    Preparing search index...

    Interface MaidrPluginOptions

    Per-chart options for the MAIDR plugin, configurable via options.plugins.maidr in the Chart.js config.

    interface MaidrPluginOptions {
        enabled?: boolean;
        title?: string;
        axes?: { x?: string; y?: string; z?: string };
        traceType?: TraceType;
        unit?: string;
        startLabel?: string;
        endLabel?: string;
        target?: number;
        bands?: GaugeBand[];
        highlightColor?: string;
    }
    Index

    Properties

    enabled?: boolean

    Set to false to disable the MAIDR plugin for a specific chart.

    title?: string

    Override the auto-detected chart title.

    axes?: { x?: string; y?: string; z?: string }

    Override axis labels.

    traceType?: TraceType

    What the chart actually is, when Chart.js cannot say.

    Several figures are drawn in Chart.js as a recipe rather than as a type of their own, and a few of those are shape-identical to another recipe: a Kaplan-Meier curve is a stepped line, a dumbbell is a horizontal floating bar exactly as a one-interval gantt is, and a gauge is a part-circle doughnut exactly as a half-pie is. Where the values cannot settle it — see the value heuristics in the extractor for the cases where they can — this is the author saying so, and it wins over every heuristic.

    unit?: string

    What one unit of a gantt chart's interval axis measures — "days", "sprints", "hours".

    The length of an interval is the fact a schedule is drawn to carry, and Chart.js states the unit nowhere: a linear axis is bare numbers, and a time axis is parsed to epoch milliseconds whatever time.unit displays. Absent, MAIDR announces a length without naming a unit rather than inventing one.

    startLabel?: string

    What a dumbbell's two ends are called — "1990" and "2020", "before" and "after".

    A dumbbell drawn as a floating bar carries one datum per row and no name for either end, so without these a reader is told which dot they are on ("start", "end") but not which year it is — the one thing the legend gives a sighted reader for free.

    endLabel?: string
    target?: number

    The target a bullet chart's marker sits at, and the qualitative bands its arc is coloured in.

    A doughnut gauge draws neither: the target is a second arc or a needle and the bands are background colours, and Chart.js records both as styling rather than as data. They are part of the reading — "7 below target, in the 'ok' band" — so the author supplies them here or they go unannounced.

    bands?: GaugeBand[]
    highlightColor?: string

    Outline color used for the DOM highlight overlay drawn on top of the canvas during MAIDR navigation. Accepts any CSS color string. Defaults to a translucent orange.