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
.
You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.
Note: You are viewing this example in debug mode with logging enabled. This can significantly slow performance.
Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings