102
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
Attribute | Default value | Type | Description |
---|---|---|---|
id | null | String | It is an unique identifier of the component. |
rendered | true | Boolean | It takes boolean value to specify the rendering of the component. |
type | null | String | It is used to specify type of the chart. |
model | null | ChartModel | It is used to set model object of data and settings. |
style | null | String | It is used to set inline style of the component. |
widgetVar | null | String | It is a name of the client side widget. |
responsive | false | Boolean | In 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:
Next TopicPrimeFaces PieChart