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.
Mushrooms Onions Type
<script src=""></script>
<p:messages id="messages">
   <p:autoUpdate />
<p:outputPanel id="container" layout="block">
    <h:panelGrid columns="4">
        <h:outputText value="Mushrooms" />
        <h:outputText value="Onions" />
        <h:outputText value="Type" />
        <p:inputText converter="javax.faces.Integer" value="#{basicGChartController.mushrooms}" />
        <p:inputText converter="javax.faces.Integer" value="#{basicGChartController.onions}" />
        <h:selectOneMenu value="#{basicGChartController.chartType}">
            <f:selectItems value="#{basicGChartController.types}"/>
        <p:commandButton value="Generate" update="container" action="#{basicGChartController.generateModel}" />

    <pe:gChart value="#{basicGChartController.chart}" title="How Much Pizza I Ate Last Night">
        <p:ajax listener="#{basicGChartController.onSelect}"/>
Components and more
Documentation pe:gChart
Attributes (move mouse over the names to see data types)
Name Description
id Unique identifier of the component in a namingContainer.
rendered Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding An el expression referring to a server side UIComponent instance in a backing bean.
width width of the chart
height height of the chart
title Title of the chart
value Value of the component. Use the GChartModelBuilder to create a new GChartModel
widgetVar Name of the client side widget.
apiKey Google Maps API Key. Can also be provided globally in web.xml as primefaces.GOOGLE_MAPS_API_KEY
Events (move mouse over the names to see classes)
Name Description
selectfired when a "row" is selected
PrimeFaces Extensions Showcase - © 2011-2018, PrimeFaces: 6.2, PrimeFaces Extensions: 6.2.1, JSF: mojarra 2.3.2, Server: jetty/9.4.2.v20170220, Build time: 2018-03-20 13:36
Thomas Andraschko
Oleg Varaksin
Nilesh Namdeo Mali
Mauricio Fenoglio
Pavol Slaný
Sudheer Jonna