eurostat-map
    Preparing search index...

    Interface RankedBarChartConfig

    Configuration for the ranked bar chart map element: one horizontal bar per region, sorted by value, labeled with its id and value. Colored by the region's own class color on map/layer types that classify regions into colored classes (choropleth, proportional symbols' color encoding), or a flat fallback color otherwise. Above an internal region-count threshold, falls back automatically to the histogram distribution view instead of drawing one bar per region.

    A standalone chart element - not a legend and not a sub-feature of one, and deliberately not an extension of LegendConfig: it has its own container/positioning and doesn't carry the legend-only concepts (no-data swatch, max/min labels, etc.) that don't apply to it. Set via map.rankedBarChart(config), separately from map.legend(config).

    interface RankedBarChartConfig {
        svgId?: string;
        x?: number;
        y?: number;
        position?: "top right" | "bottom right" | "top left" | "bottom left";
        width?: number;
        height?: number;
        title?: string;
        subtitle?: string;
        boxPadding?: number;
        boxOpacity?: number;
        onlyApplyOpacityWhileZoomed?: boolean;
        shapeHeight?: number;
        labelFontSize?: number;
        labelFormatter?: (value: number, index?: number) => string;
        decimals?: number;
        ascending?: boolean;
        countryGroup?: "eu" | "euEfta" | "euEftaCc";
    }
    Index

    Properties

    svgId?: string

    Id of the SVG element to render the chart into. Can be a completely different container/ SVG to the legend's.

    an internally-generated id
    
    x?: number

    Chart origin x-coordinate in pixels.

    y?: number

    Chart origin y-coordinate in pixels.

    position?: "top right" | "bottom right" | "top left" | "bottom left"

    Automatically position the chart in a map corner. Manual x/y coordinates take precedence.

    width?: number

    Approximate box width in pixels, used only as a fallback when auto-positioning in a corner without explicit x/y.

    150
    
    height?: number

    Maximum total height in pixels for the rendered chart (title/subtitle + bars). When the natural height of all bars would exceed this, bar height and label font size are both scaled down proportionally so the chart never grows taller than this budget. Omit to let the chart grow to fit its content - its natural height with ~35 EU/EFTA/CC regions can easily exceed a map's own height.

    title?: string

    Chart title text.

    subtitle?: string

    Chart subtitle text.

    boxPadding?: number

    Inner spacing around the chart content in pixels.

    7
    
    boxOpacity?: number

    Background opacity of the chart's box.

    0.9
    
    onlyApplyOpacityWhileZoomed?: boolean

    Apply the chart box's background opacity (boxOpacity) only while the map is currently zoomed in (scale != 1). Purely a box-opacity concern - does not affect hover interactions (e.g. hover-to-highlight), which always work regardless of zoom state.

    shapeHeight?: number

    Bar height in pixels, before any height-based scaling (see height).

    20
    
    labelFontSize?: number

    Label font size in pixels, before any height-based scaling (see height).

    read from the .em-legend-label CSS class
    
    labelFormatter?: (value: number, index?: number) => string

    Custom formatter for each region's value label.

    decimals?: number

    Number of decimal places for auto-formatted value labels. Auto-detected when undefined.

    ascending?: boolean

    Sort bars in ascending order of value when true, descending when false.

    true
    
    countryGroup?: "eu" | "euEfta" | "euEftaCc"

    Limit which regions appear to a political grouping: EU member states, EU + EFTA, or EU + EFTA + EU candidate countries. Applied before the region-count threshold that triggers the histogram distribution fallback. Omit (default) to show every region with a value, unfiltered.