4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp<html>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp <head>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp <meta http-equiv="content-type" content="text/html; charset=utf-8">
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp <style>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp /*Supplemental: CSS for the YUI distribution*/
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp #custom-doc { width: 95%; min-width: 950px; }
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp #pagetitle {background-image: url(/assets/bg_hd.gif);}
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp #mychart {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp padding:10px 10px 10px 10px;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp </style>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp <link rel="stylesheet" type="text/css" href="/build/cssfonts/fonts-min.css">
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp </head>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp<body class="yui3-skin-sam">
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp<h3>Aria Line Tests</h3>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp<div id="mychart"></div>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp<script type="text/javascript" src="/build/yui/yui-min.js"></script>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp<script>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28TrippYUI({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp allowRollup: false,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min'
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp}).use('charts', 'test', 'console', function (Y)
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp{
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.namespace("example.test");
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp var suite = new Y.Test.Suite("Y.Charts.AriaLine"),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp myDataValues = [
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/1/2010", values:2000, expenses:3700, revenue:2200},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/2/2010", values:50, expenses:9100, revenue:100},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/3/2010", values:400, expenses:1100, revenue:1500},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/4/2010", values:200, expenses:1900, revenue:2800},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/5/2010", values:5000, expenses:5000, revenue:2650}
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp ],
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp pieDataValues = [
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/1/2010", revenue:2200},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/2/2010", revenue:100},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/3/2010", revenue:1500},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/4/2010", revenue:2800},
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {category:"5/5/2010", revenue:2650}
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp ],
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription = "Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultPieAriaDescription = "Use the left and right keys to navigate through items.",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp seriesKeys = ["values", "revenue"],
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width = 400,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height = 300;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp function AriaTests(cfg, testConfig)
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp AriaTests.superclass.constructor.apply(this);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp this.attrConfig = cfg;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp this.name = testConfig.type + " Aria Tests";
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp this.defaultAriaDescription = testConfig.defaultAriaDescription;;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.extend(AriaTests, Y.Test.Case, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaLabel: "Chart Application",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp changedAriaLabel: "This is a new ariaLabel value.",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp setUp: function() {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp var mychart = new Y.Chart(this.attrConfig);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp this.chart = mychart;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp },
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp tearDown: function() {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp this.chart.destroy();
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp },
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp "test:getAriaLabel()": function()
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.Assert.isTrue(this.chart.get("ariaLabel") == this.defaultAriaLabel);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp },
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp "test:setAriaLabel()": function()
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp var chart = this.chart;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp chart.set("ariaLabel", this.changedAriaLabel);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.Assert.isTrue(chart.get("ariaLabel") == this.changedAriaLabel);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp },
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp "test:getAriaDescription()": function()
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.Assert.isTrue(this.chart.get("ariaDescription") == this.defaultAriaDescription);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp },
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp "test:setAriaDescription()": function()
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp var chart = this.chart;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp chart.set("ariaDescription", this.changedAriaLabel);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.Assert.isTrue(chart.get("ariaDescription") == this.changedAriaLabel);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp });
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.AriaTests = AriaTests;
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp var comboTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "combo",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "Combo",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stackedComboTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "combo",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stacked: true,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "StackedCombo",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp areaTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "area",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "Area",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stackedAreaTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "area",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stacked: true,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "StackedArea",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp lineTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "line",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "Line",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stackedLineTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "line",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stacked: true,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "StackedLine",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp markerTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "markerseries",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "Marker",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }),
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stackedMarkerTests = new Y.AriaTests({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp dataProvider: myDataValues,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp render: "#mychart",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "markerseries",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp stacked: true,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp width: width,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp height: height
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp }, {
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp type: "StackedMarker",
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp defaultAriaDescription: defaultAriaDescription
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp });
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(comboTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(stackedComboTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(areaTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(stackedAreaTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(lineTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(stackedLineTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(markerTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp suite.add(stackedMarkerTests);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp //create the console
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp var r = new Y.Console({
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp newestOnTop : false,
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp style: 'block' // to anchor in the example content
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp });
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp r.render('#testLogger');
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp //run the tests
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.Test.Runner.setName("Y.Charts.AriaLine");
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.Test.Runner.add(suite);
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp Y.Test.Runner.run();
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp});
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp</script>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp</body>
4c307472e86c080e30ac5eb2ce60ab4f6fc10b28Tripp</html>