Values accessor
By default we assume that `items` has the shape `{key, value}`.
By providing a `valueAccessor` function we can derive the bar value from `items` with different shapes.
Usage
<BarchartVDiv {items} valueAccessor={item => Number((item.rawValue / 25.3).toFixed(3))} />
Props
items
- (49) [ {…} ,{…} ,{…} ,{…} ,{…} , … ]
- 0: { key: "AL" ,rawValue: 112 }
- 1: { key: "AD" ,rawValue: 234 }
- 2: { key: "AM" ,rawValue: 36 }
- 3: { key: "AT" ,rawValue: 357 }
- 4: { key: "AZ" ,rawValue: 123 }
- 5: { key: "BY" ,rawValue: 56 }
- 6: { key: "BE" ,rawValue: 15 }
- 7: { key: "BA" ,rawValue: 12 }
- 8: { key: "BG" ,rawValue: 568 }
- 9: { key: "HR" ,rawValue: 213 }
- 10: { key: "CY" ,rawValue: 456 }
- 11: { key: "CZ" ,rawValue: 21 }
- 12: { key: "DK" ,rawValue: 345 }
- 13: { key: "EE" ,rawValue: 37 }
- 14: { key: "FI" ,rawValue: 376 }
- 15: { key: "FR" ,rawValue: 346 }
- 16: { key: "GE" ,rawValue: 17 }
- 17: { key: "DE" ,rawValue: 567 }
- 18: { key: "GR" ,rawValue: 47 }
- 19: { key: "HU" ,rawValue: 23 }
- 20: { key: "IS" ,rawValue: 578 }
- 21: { key: "IE" ,rawValue: 24 }
- 22: { key: "IT" ,rawValue: 6 }
- 23: { key: "KZ" ,rawValue: 5 }
- 24: { key: "LV" ,rawValue: 58 }
- 25: { key: "LI" ,rawValue: 5 }
- 26: { key: "LT" ,rawValue: 69 }
- 27: { key: "LU" ,rawValue: 23 }
- 28: { key: "MT" ,rawValue: 36 }
- 29: { key: "MD" ,rawValue: 57 }
- 30: { key: "MC" ,rawValue: 69 }
- 31: { key: "ME" ,rawValue: 223 }
- 32: { key: "NL" ,rawValue: 35 }
- 33: { key: "MK" ,rawValue: 57 }
- 34: { key: "NO" ,rawValue: 79 }
- 35: { key: "PL" ,rawValue: 12 }
- 36: { key: "PT" ,rawValue: 46 }
- 37: { key: "RO" ,rawValue: 37 }
- 38: { key: "RU" ,rawValue: 678 }
- 39: { key: "SM" ,rawValue: 345 }
- 40: { key: "RS" ,rawValue: 67 }
- 41: { key: "SK" ,rawValue: 23 }
- 42: { key: "SI" ,rawValue: 567 }
- 43: { key: "ES" ,rawValue: 23 }
- 44: { key: "SE" ,rawValue: 768 }
- 45: { key: "CH" ,rawValue: 56 }
- 46: { key: "TR" ,rawValue: 78 }
- 47: { key: "UA" ,rawValue: 2 }
- 48: { key: "GB" ,rawValue: 56 }
- length: 49
valueAccessor
- ƒ item => Number(Math.sqrt(item.rawValue)
- length: 1
- name: "valueAccessor"
- [[Function]]: item => Number(Math.sqrt(item.rawValue).toFixed(3))
- [[Prototype]]: ƒ ()