Labels (via mapping)

By providing a object mapping bar key -> bar label, you can control how the bar are labeled.

The chart adapts by laying out labels according to the available width, and shortening them and adding an ellipsis if necessary.

Choose an example

Usage

<BarchartVDiv
  {items}
  {keyToLabel}
/>

Props

keyToLabel

    { AL: "Albania" ,AD: "Andorra" ,AM: "Armenia" ,AT: "Austria" ,AZ: "Azerbaijan" , }
    • AL: "Albania"
    • AD: "Andorra"
    • AM: "Armenia"
    • AT: "Austria"
    • AZ: "Azerbaijan"
    • BY: "Belarus"
    • BE: "Belgium"
    • BA: "Bosnia and Herzegovina"
    • BG: "Bulgaria"
    • HR: "Croatia"
    • CY: "Cyprus"
    • CZ: "Czechia"
    • DK: "Denmark"
    • EE: "Estonia"
    • FI: "Finland"
    • FR: "France"
    • GE: "Georgia"
    • DE: "Germany"
    • GR: "Greece"
    • HU: "Hungary"
    • IS: "Iceland"
    • IE: "Ireland"
    • IT: "Italy"
    • KZ: "Kazakhstan"
    • LV: "Latvia"
    • LI: "Liechtenstein"
    • LT: "Lithuania"
    • LU: "Luxembourg"
    • MT: "Malta"
    • MD: "Moldova"
    • MC: "Monaco"
    • ME: "Montenegro"
    • NL: "Netherlands"
    • MK: "North Macedonia (formerly Macedonia)"
    • NO: "Norway"
    • PL: "Poland"
    • PT: "Portugal"
    • RO: "Romania"
    • RU: "Russian Federation"
    • SM: "San Marino"
    • RS: "Serbia"
    • SK: "Slovakia"
    • SI: "Slovenia"
    • ES: "Spain"
    • SE: "Sweden"
    • CH: "Switzerland"
    • TR: "Turkey"
    • UA: "Ukraine"
    • GB: "United Kingdom (UK)"

items

    (49) [ {…} ,{…} ,{…} ,{…} ,{…} , ]
    • 0: { key: "SE" ,value: 768 }
    • 1: { key: "RU" ,value: 678 }
    • 2: { key: "IS" ,value: 578 }
    • 3: { key: "BG" ,value: 568 }
    • 4: { key: "DE" ,value: 567 }
    • 5: { key: "SI" ,value: 567 }
    • 6: { key: "CY" ,value: 456 }
    • 7: { key: "FI" ,value: 376 }
    • 8: { key: "AT" ,value: 357 }
    • 9: { key: "FR" ,value: 346 }
    • 10: { key: "DK" ,value: 345 }
    • 11: { key: "SM" ,value: 345 }
    • 12: { key: "AD" ,value: 234 }
    • 13: { key: "ME" ,value: 223 }
    • 14: { key: "HR" ,value: 213 }
    • 15: { key: "AZ" ,value: 123 }
    • 16: { key: "AL" ,value: 112 }
    • 17: { key: "NO" ,value: 79 }
    • 18: { key: "TR" ,value: 78 }
    • 19: { key: "LT" ,value: 69 }
    • 20: { key: "MC" ,value: 69 }
    • 21: { key: "RS" ,value: 67 }
    • 22: { key: "LV" ,value: 58 }
    • 23: { key: "MD" ,value: 57 }
    • 24: { key: "MK" ,value: 57 }
    • 25: { key: "BY" ,value: 56 }
    • 26: { key: "CH" ,value: 56 }
    • 27: { key: "GB" ,value: 56 }
    • 28: { key: "GR" ,value: 47 }
    • 29: { key: "PT" ,value: 46 }
    • 30: { key: "EE" ,value: 37 }
    • 31: { key: "RO" ,value: 37 }
    • 32: { key: "AM" ,value: 36 }
    • 33: { key: "MT" ,value: 36 }
    • 34: { key: "NL" ,value: 35 }
    • 35: { key: "IE" ,value: 24 }
    • 36: { key: "HU" ,value: 23 }
    • 37: { key: "LU" ,value: 23 }
    • 38: { key: "SK" ,value: 23 }
    • 39: { key: "ES" ,value: 23 }
    • 40: { key: "CZ" ,value: 21 }
    • 41: { key: "GE" ,value: 17 }
    • 42: { key: "BE" ,value: 15 }
    • 43: { key: "BA" ,value: 12 }
    • 44: { key: "PL" ,value: 12 }
    • 45: { key: "IT" ,value: 6 }
    • 46: { key: "KZ" ,value: 5 }
    • 47: { key: "LI" ,value: 5 }
    • 48: { key: "UA" ,value: 2 }
    • length: 49
Swede…768 Russian Federatio…678 Icelan…578 Bulgari…568 German…567 Sloveni…567 Cypru…456 Finlan…376 Austri…357 Franc…346 Denmar…345 San Marin…345 Andorr…234 Montenegr…223 Croati…213 Azerbaija…123 Albani…112 Norwa…79 Turke…78 Lithuani…69 Monac…69 Serbi…67 Latvi…58 Moldov…57 North Macedonia (formerly Macedonia…57 Belaru…56 Switzerlan…56 United Kingdom (UK…56 Greec…47 Portuga…46 Estoni…37 Romani…37 Armeni…36 Malt…36 Netherland…35 Irelan…24 Hungar…23 Luxembour…23 Slovaki…23 Spai…23 Czechi…21 Georgi…17 Belgiu…15 Bosnia and Herzegovin…12 Polan…12 Ital…6 Kazakhsta…5 Liechtenstei…5 Ukrain…2