ForgeComponents
en

Components

j-DonutChart

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

Configuration:

  • tooltip {Boolean} enables tooltip (default: true)
  • format {String} a template (Tangular) for rendering tooltip (default: {{ value | format(0) }})
  • presentation {Boolean} enables presentation mode (default: true)
  • select {String} a path to method if a value is selected
  • redraw {String} a path to method if the chart is redrawn
  • animate {Boolean} enables/disables animations (default: false)
  • size {Number/String} width/height of donut (default: 0 = auto) or string is meant as a parent element
  • highlight {Boolean} enables/disables highlight of pieces (default: true)
  • margin {Number} adds a margin to size (default: 0)

Use it with <ui-component name="donutchart">. 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
<div class="container">
	<div class="row">
		<div class="col-xs-6">
			<ui-component name="donutchart" path="values"></ui-component>
		</div>
		<div class="col-xs-6">
			<div class="row">
				<div class="col-xs-6">
					<ui-component name="donutchart" path="values"></ui-component>
				</div>
				<div class="col-xs-6">
					<ui-component name="donutchart" path="values"></ui-component>
				</div>
			</div>
			<br />
			<div class="row">
				<div class="col-xs-6">
					<ui-component name="donutchart" path="values"></ui-component>
				</div>
				<div class="col-xs-6">
					<ui-component name="donutchart" path="values" config="animate:false"></ui-component>
				</div>
			</div>
		</div>
	</div>
</div>

<script>
	var values = [{ name: 'A', value: 10 }, { name: 'B', value: 4 }, { name: 'C', value: 20 }, { name: 'D', value: 8 }];
</script>