• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

Charts Facet

For simpler charts you can render the chart right in the value facet.

Chart Tag Documentation

Chart.js component using raw JSON or XDev model.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
ariaLabel String false The aria-label attribute is used to define a string that labels the current element for accessibility.
canvasStyle String false Inline style of the canvas element.
canvasStyleClass String false Style class of the canvas element.
extender String false Name of javascript function to extend the options of the underlying Chart.js plugin.
style String false Inline style of the component.
styleClass String false Style class of the component.
value String false Chart model data as a JSON string, either generated from an XDEV model object or provided as raw JSON configuration.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc

Usage


<div class="card">
    <p:chart style="width: 100%; height: 500px;">
       <f:facet name="value">
       {
         type: 'bar',
         data: {
           labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
           datasets: [{
             label: '# of Votes',
             data: [12, 19, 3, 5, 2, 3],
             borderWidth: 1,
             backgroundColor: ['DarkRed', 'CornflowerBlue', 'Gold', 'Lime', 'BlueViolet', 'DarkOrange']
           }]
         },
         options: {
           scales: {
             y: {
               beginAtZero: true
             }
           },
           plugins: {
               zoom: {
                   pan: {
                       enabled: true,
                       mode: 'y',
                       threshold: 5,
                   },
                   zoom: {
                       wheel: {
                           enabled: true
                       },
                       pinch: {
                           enabled: true
                       },
                       mode: 'y',
                   },
               }
           }
         }
       }
       </f:facet>
    </p:chart>
</div>