arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
GChart
The GChart component needs a GChartModel object that can be created with a GChartModelBuilder. It's also possible to add an ajax listener on the "select" event. The event contains a reference to a JSONArray object with the information about the selected rows.
MushroomsOnionsType
Source

<script src="https://www.gstatic.com/charts/loader.js"></script>
<p:messages id="messages">
   <p:autoUpdate />
</p:messages>
<p:outputPanel id="container" layout="block">
    <h:panelGrid columns="4">
        <h:outputText value="Mushrooms" />
        <h:outputText value="Onions" />
        <h:outputText value="Type" />
        <h:panelGroup/>
        <p:inputText converter="jakarta.faces.Integer" value="#{basicGChartController.mushrooms}" />
        <p:inputText converter="jakarta.faces.Integer" value="#{basicGChartController.onions}" />
        <h:selectOneMenu value="#{basicGChartController.chartType}">
            <f:selectItems value="#{basicGChartController.types}"/>
        </h:selectOneMenu>
        <p:commandButton value="Generate" update="container" action="#{basicGChartController.generateModel}" />
    </h:panelGrid>

    <pe:gChart value="#{basicGChartController.chart}" title="How Much Pizza I Ate Last Night">
        <p:ajax listener="#{basicGChartController.onSelect}"/>
    </pe:gChart>
</p:outputPanel>
            
Components and more
Documentation pe:gChart
Attributes (move mouse over the names to see data types)
Name Description
apiKeyGoogle Charts API key.
bindingAn EL expression referring to a server side UIComponent instance in a backing bean.Default is generated.
converterEL expression resolves to a converter instance or literal converter ID defining a component converter.
extenderJavaScript extender function name.
heightChart height in pixels.
idUnique identifier of the component in a namingContainer.Default is generated.
languageLanguage code for the chart.Default is en.
renderedBoolean value to specify the rendering of the component, when set to false component will not be rendered.Default is true.
titleChart title.
valueValue of the chart. Use the GChartModelBuilder to create a new GChartModel
widgetVarName of the client side widget.
widthChart width in pixels.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 16.0.0-SNAPSHOT,PrimeFaces Extensions: 16.0.0-SNAPSHOT,JSF: Apache MyFaces Core 4.0 - Impl 4.0.3,Server: Apache Tomcat (TomEE)/10.1.52 (10.1.4),Build time: 2026-03-16 12:06