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.
This example uses the YUI Charts Control and the TabView Control to display different views of the same DataSource.
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.
We can start by setting our styles for our charts and tabview container divs. This just sizes the charts and tab container, and gives us a custom style for the chart title.
We'll create a DataSource that will be used in all of our charts.
We will create a TabView with the following tabs: Bar Chart, Line Chart and Column Chart. Each tab's contents will contain description text and a container div for its corresponding chart.
Since a Bar Chart displays its data on the x axis, it will need a different series definition than the Line Chart and Column Chart.
We will create a Numeric Axis and its formatting functions. Again, we will need to accomodate the fact that Bar Chart displays its currency on a different axis.
Finally, we'll create our three charts and assign each to its corresponding container div.
The Bar Chart has currencyAxis
assigned to the xAxis
and YAHOO.example.getXAxisDataTipText
assigned as its dataTipFunction
while the Line and Column Charts have the currencyAxis
assigned to the yAxis
and getYAxisDataTipText
assigned as the dataTipFunction
.
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.