YUI recommends YUI3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
This documentation is no longer maintained.
A legend may be displayed with the YUI Charts Control by setting a few simple styles. This example shows you how.
Please note: The YUI Charts Control requires Flash Player 9.0.45 or higher. The latest version of Flash Player is available at the Adobe Flash Player Download Center.
The Charts Control may display a legend by specifying the legend display style. Accepted values include "top"
, "right"
, "bottom"
, "left"
, and the default value "none"
.
Legends that are displayed on the left or right sides will arrange their series or category items vertically. When you specify that the legend should be displayed on the top or bottom, it will arrange its items horizontally.
Several substyles are available to allow you to customize the legend to fit your needs. In this example, we customize the font used by the text in the legend, the padding between the legend's items and the edge of the legend, and the spacing between the legend's items.
There are more styles available for legends, including border and background options. For full details about the legend styles, read the Charts Control User's Guide.
Note: You are viewing this example in debug mode with logging enabled. This can significantly slow performance.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.
Copyright © 2013 Yahoo! Inc. All rights reserved.