# j-BarChart

> Please review an example and keep a data-source.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: cea304818ea5d9fec74a7586217cf05c3faceb61a4baf158589fc9914f743240
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

Please review an example and keep a data-source.


__Configuration__:

- `paddingbars {Number}` padding between bars (default: `5`)
- `paddinggroup {Number}` padding between groups of bars (default: `10`)
- `radius {Number}` enables presentation mode (default: `2`)
- `offsetX {Number}` An offset X for value tooltip (default: `10`)
- `offsetY {Number}` An offset Y for value tooltip (default: `10`)
- `templateX {String}` Tangular template for X axis (default: `{{ value }}`)
- `templateY {String}` Tangular template for Y axis (default: `{{ value | format(0) }}`)
- `height {Number/String}` height (default: `0` = auto-height) or `string` is meant as a parent element
- `width {Number/String}` width (default: `0` = auto-width) or `string` is meant as a parent element
- `limit {Number}` a maximum limit of value for Y axis (default: `0`)
- `pl {Number}` left padding for axis (default: `0`)
- `pr {Number}` lines right padding (default: `10`)
- `pt {Number}` lines top padding (default: `10`)
- `pb {Number}` lines bottom padding (default: `25`)
- `prselected {Number}` right padding for selected value (default: `0`)
- `marginW {Number}` a margin for `width`
- `marginH {Number}` a margin for `height`

Use it with `<ui-component name="barchart">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<div class="container">
	<div class="row">
		<div class="col-sm-6">
			<ui-component name="barchart" path="values"></ui-component>
		</div>
	</div>
</div>

<script>
	var values = [];

	values.push({
		name: 'Apples',
		values: [{ x: 2009, y: 100 }, { x: 2010, y: 120 }, { x: 2011, y: 130 }, { x: 2012, y: 150 }, { x: 2013, y: 50 }, { x: 2014, y: 200 }, { x: 2015, y: 80 }, { x: 2016, y: 170 }, { x: 2017, y: 300 }]
	});

	values.push({
		name: 'Oranges',
		values: [{ x: 2009, y: 40 }, { x: 2010, y: 80 }, { x: 2011, y: 400 }, { x: 2012, y: 170 }, { x: 2013, y: 90 }, { x: 2014, y: 60 }, { x: 2015, y: 160 }, { x: 2016, y: 120 }, { x: 2017, y: 180 }]
	});

	values.push({
		name: 'Bananas',
		values: [{ x: 2009, y: 80 }, { x: 2010, y: 40 }, { x: 2011, y: 300 }, { x: 2012, y: 200 }, { x: 2013, y: 120 }, { x: 2014, y: 150 }, { x: 2015, y: 220 }, { x: 2016, y: 40 }, { x: 2017, y: 80 }]
	});
</script>
```
