Creating a meter gauge chart

The meterGauge component visualizes data on a meter gauge display.

How to do it...

A simple definition for a meter gauge to list metric tons per year is shown as follows:

<p:meterGaugeChart id="simple" value="#{meterGaugeController.model}" style="height:250px" />

The chart will be rendered as shown in the following screenshot:

How to do it...

The model that binds to the component should be an instance of org.primefaces.model.chart.MeterGaugeChartModel. The definition for the model with the ticks and intervals is given as follows:

List<Number> intervals = new ArrayList<Number>(){{ add(22000); add(55000); add(70000); }}; List<Number> ticks ...

Get PrimeFaces Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.