O'Reilly logo

PrimeFaces Cookbook by Mert Çalışkan, Oleg Varaksin

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 bubble chart

The bubbleChart component renders the data points displayed as colored circles with an optional text label inside.

How to do it...

A simple definition for a bubble chart to list public road mileage, the number of fatal crashes, and average annual daily traffic for a list of states is given as follows:

<p:bubbleChart value="#{bubbleChartController.model}" style="height:250px" xaxisLabel="Number of Fatal Crashes" yaxisLabel="Public Road Mileage" />

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.BubbleChartModel.

BubbleChartModel ...

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