PrimeFace AreaChart

It is a customized and advanced version of a LineChart where series are filled. It is used to represent statistical data graphically. The <p:chart> is a generic component to create chart in JSF application. We can set type of chart to specify the type pf chart.

The chart has various attributes that are tabled below. These attributes are generic and applicable for all type of charts.

Chart Attributes

AttributeDefault valueTypeDescription
idnullStringIt is an unique identifier of the component.
renderedtrueBooleanIt takes boolean value to specify the rendering of the component.
typenullStringIt is used to specify type of the chart.
modelnullChartModelIt is used to set model object of data and settings.
stylenullStringIt is used to set inline style of the component.
widgetVarnullStringIt is a name of the client side widget.
responsivefalseBooleanIn responsive mode, chart is redrawn when window is resized.

Example

Here, in the following example, we are implementing <p:chart> component. This example contains the following files.

JSF File

// area.xhtml

ManagedBean

// Area.java

Output:

PrimeFaces AreaChart 1