Creating a Donut chart
The Donut chart visualizes a multiseries Pie chart in a single plot. The Donut chart uses the org.primefaces.model.chart.DonutChartModel
type instance as a backing bean model.
Let us see how we can create a Donut chart representing the number of posts being posted with various tags in years 2011, 2012, and 2013 years.
<p:donutChart value="#{chartController.donutChartModel}" style="width: 350px; height: 250px;" legendPosition="se" sliceMargin="5" dataFormat="value" /> public class ChartController { private DonutChartModel donutChartModel; public ChartController() { donutChartModel = new DonutChartModel(); Map<String, Number> year2011Circle = new HashMap<String, Number>(); year2011Circle.put("PrimeFaces", 80); year2011Circle.put("jQuery", 350); year2011Circle.put("JSF", 50); donutChartModel.addCircle(year2011Circle); Map<...