MAIDR JavaScript API
    Preparing search index...

    Interface AnyChartBinderOptions

    Options the consumer can pass when binding an AnyChart chart to MAIDR.

    interface AnyChartBinderOptions {
        id?: string;
        title?: string;
        axes?: { x?: string; y?: string };
        diverging?: boolean;
        selectors?: (string | string[] | undefined)[];
    }
    Index

    Properties

    id?: string

    Override the chart ID used in the MAIDR schema. Defaults to the chart container element's id attribute.

    title?: string

    Override the chart title. Defaults to chart.title().text().

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

    Override axis labels.

    diverging?: boolean

    Read this chart's bar series as the two sides of a diverging bar chart — a tornado chart, or a population pyramid.

    Opt-in rather than inferred, because AnyChart has no diverging chart type to detect. The idiom is an ordinary stacked anychart.bar() whose two series straddle zero, and nothing distinguishes that from a stacked bar chart that merely contains negative values — so guessing would rename an ordinary chart, and a diverging trace announces a side in place of the sign, which is exactly the clue a reader would need to catch the mistake.

    The sides are emitted signed, in declared order, as the chart draws them: MAIDR takes the magnitude for the pitch and the sign for the side.

    false
    
    selectors?: (string | string[] | undefined)[]

    CSS selector overrides for SVG element highlighting.

    Each element in the array corresponds to a series by index. Use undefined at a given position to skip that series (no highlighting).

    AnyChart's internal SVG structure does not expose stable class names, so consumers should inspect the rendered DOM and provide explicit selectors for reliable highlighting.

    // Apply per-series selectors (2 series, second has none):
    selectors: ['.series-0 rect', undefined]

    // Apply the same selector to all series:
    selectors: ['.chart rect']