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.

YUI Library Examples: Charts Control: Column Chart with Rotated Title and Labels

Charts Control: Column Chart with Rotated Title and Labels

Axes Title and Label fields can be rotated on the YUI Charts Control by setting the titleRotation and labelRotation axis 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.

Monthly Expenses
Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the Adobe Flash Player Download Center.

Data

We will start by adding our data for the charts.

Series and Styles

Next we'll add a series to our chart, and give it a style.

In the styles for our x-axis and y-axis, we'll set the corresponding labelRotation and titleRotation to -90. This will make the title on the y-axis and the labels on the x-axis to be rotated -90 degrees (counterclockwise). While both styles accept values between -90 and 90, it is generally recomended to only use the values -90, 90 or 0 (default), as text fields will display more clearly at these settings.

Chart

Add our axes and label formatting methods.

Finally, we'll add the chart and call it good.

There are even more styles available for the axes than we've covered in this tutorial. For full details about the axes styles, read the Charts Control User's Guide.

Copyright © 2013 Yahoo! Inc. All rights reserved.

Privacy Policy - Copyright Policy - Job Openings