Javatpoint Logo
Javatpoint Logo

<apex: messages> Component in Visualforce Page

The <apex: legend> is another important component for defining the chart legend. It provides additional configuration options beyond the defaults used by the legend attribute of the <apex: chart> component. The <apex: legend> component is used within the <apex: chart>.

The <apex: legend> component has the following attributes:

1. font

The font is a string-type attribute used for specifying the font for the legend text. The value of this attribute is specified as a CSS-style font definition.


2. id

The id is a string-type attribute, i.e., a unique identifier that allows this component to be referenced by other components on the page.


3. padding

The padding is an integer-type attribute that defines the amount of spacing between the content and the legend's border. We specify the value in pixels for this attribute.


4. position

The position is a string-type attribute used for specifying the legend's position in relation to the chart. These are the possible values for this attribute:

  1. top
  2. bottom
  3. right
  4. left


5. rendered

The rendered is a Boolean-type attribute used to specify whether this component is rendered with the chart. The boolean value true is set as a default value for this attribute.



The spacing is an integer-type attribute used to specify the amount of spacing between legend items. The value of this attribute is specified in pixels.


Let's take an example to understand how we can use this component on the VF page:




apex: legend Component in Visualforce Page

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA