ForgeComponents
en

Components

j-StatsBarSimple

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

Configuration:

  • tooltip {Boolean} enables tooltips (default: true)
  • animate {Boolean} enables animation (default: true)
  • value {String} a key for the value field (default: value)
  • colors {String} predefined colors

The component needs to have a defined template for rendering content and a tooltip. For an understanding look to the example.

Use it with <ui-component name="statsbarsimple">. 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.

example.html
<ui-component name="LAZY tooltip"></ui-component>

<ui-component name="statsbarsimple" path="mystats">
	<script type="text/html">
		{{ name }} {{ value | format(0) }} visitors / {{ percentage }}%
	</script>
	<script type="text/html">
		Tooltip: {{ name }} {{ percentage }}%
	</script>
</ui-component>

<script>
	var mystats = [{ name: 'Social', value: 40, color: '#649BD0' }, { name: 'Advert', value: 98, color: '#EF914E' }, { name: 'Search', value: 59, color: '#87C17E' }, { name: 'Direct', value: 76, color: '#9D9BC5' }];
</script>