O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required