• 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

Legend

Legend creates a key for a map and is useful for displaying titles, descriptions and keys for what is being mapped, horizontally or vertically. Based on TileMill CSS Legend.

Legend Tag Documentation

Legend component for chart labels and colors.

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.
footer String false Legend footer.
layout String false vertical Layout orientation: vertical or horizontal.
style String false Inline style of the component.
styleClass String false Style class of the component.
title String false Legend title.
values Map false Map of label to color for legend items.
Tag Documentation Widget Source
Basic Usage

Legend makes it easy to add a key to your UI, for example to a map or to a PrimeFaces Timeline. Title and footer are attributes or facets.

Vertical Title
  • 0 - 20%
  • 40%
  • 60%
  • 80%
  • 100%
Horizontal Title Facet
  • 0 - 20%
  • 40%
  • 60%
  • 80%
  • 100%

Usage


<div class="card">
    <h5>Basic Usage</h5>
    <p>Legend makes it easy to add a key to your UI, for example to a map or to a PrimeFaces Timeline. Title and footer are attributes or facets.</p>
    <h:form id="formBasicUsage">
        <p:panelGrid id="pnlLegend" columns="2" styleClass="p-noborder" layout="tabular">
            <p:outputLabel value="Vertical"/>
            <pe:legend layout="vertical" widgetVar="lgndVertical" values="#{legendController.values}" title="Vertical Title" footer="Source: PrimeFaces"/>

            <p:spacer/>
            <p:spacer/>

            <p:outputLabel value="Horizontal"/>
            <pe:legend layout="horizontal" widgetVar="lgndHorizontal" values="#{legendController.values}">
                <f:facet name="title">
                    Horizontal Title Facet
                </f:facet>
                <f:facet name="footer">
                    Source: <a href="http://www.primefaces.org">PrimeFaces Rocks!</a>
                </f:facet>
            </pe:legend>
        </p:panelGrid>
    </h:form>
</div>