3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp<html>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp <head>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp <meta http-equiv="content-type" content="text/html; charset=utf-8">
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp <style>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp /*Supplemental: CSS for the YUI distribution*/
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp #custom-doc { width: 95%; min-width: 950px; }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp #pagetitle {background-image: url(/assets/bg_hd.gif);}
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp #mychart {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp padding:10px 10px 10px 10px;
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp </style>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp <link rel="stylesheet" type="text/css" href="/build/cssfonts/fonts-min.css">
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp </head>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp<body class="yui3-skin-sam">
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp<h3>Unit Tests</h3>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp<div id="mychart"></div>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp<script type="text/javascript" src="/build/yui/yui-min.js"></script>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp<script>
3a0e3386da06b00e0461e54ce61efafa74ed0da0TrippYUI({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp allowRollup: false,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min'
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp}).use('charts-legend', 'test', 'console', function (Y)
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp{
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp Y.namespace("example.test");
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var suite = new Y.Test.Suite("Y.Charts.Legend"),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp LegendTestTemplate = function(cfg, globalCfg)
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var i;
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp LegendTestTemplate.superclass.constructor.apply(this);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp cfg.width = cfg.width || 400;
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp cfg.height = cfg.height || 300;
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp cfg.categoryKey = "date";
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp this.attrCfg = cfg;
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp for(i in globalCfg)
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp if(globalCfg.hasOwnProperty(i))
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp this[i] = globalCfg[i];
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp };
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp Y.extend(LegendTestTemplate, Y.Test.Case, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp setUp: function() {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp this.chart = new Y.Chart(this.attrCfg);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp tearDown: function() {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp this.chart.destroy(true);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp });
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var basicDataValues = [
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {date:"5/1/2010", miscellaneous:2000, expenses:3700, revenue:2200},
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {date:"5/2/2010", miscellaneous:50, expenses:9100, revenue:100},
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {date:"5/3/2010", miscellaneous:400, expenses:1100, revenue:1500},
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {date:"5/4/2010", miscellaneous:200, expenses:1900, revenue:2800},
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {date:"5/5/2010", miscellaneous:5000, expenses:5000, revenue:2650}
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp ],
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp topLegend = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp return {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp position: "top",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp styles: {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp hAlign: "center"
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp };
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp bottomLegend = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp return {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp position: "bottom",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp styles: {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp hAlign: "center"
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp };
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp leftLegend = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp return {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp position: "left",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp styles: {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp vAlign: "middle"
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp };
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp rightLegend = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp return {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp position: "right",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp styles: {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp vAlign: "middle"
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp };
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var assert = Y.Assert,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp chart = this.chart,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend = chart.get("legend");
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp assert.isTrue(legend instanceof Y.ChartLegend);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegendPosition = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var assert = Y.Assert,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp chart = this.chart,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend = chart.get("legend");
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp assert.areEqual(legend.get("position"), this.legendPosition);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegendItemsLength = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var assert = Y.Assert,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp chart = this.chart,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend = chart.get("legend"),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp chartSC = chart.get("seriesCollection"),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legendItems = legend.get("items");
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp assert.areEqual(chartSC.length, legendItems.length);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegendItemsText = function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var assert = Y.Assert,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp chart = this.chart,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend = chart.get("legend"),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp chartSC = chart.get("seriesCollection"),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legendItems = legend.get("items"),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp i = 0,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp len = chartSC.length;
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp for(; i < len; ++i)
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp assert.areEqual(chartSC[i].get("displayName"), legendItems.text);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp },
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp NoLegendTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart"
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "No Legend Tests",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testNoLegend: function()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var assert = Y.Assert,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp chart = this.chart,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend = chart.get("legend");
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp assert.isUndefined(legend);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp TopLegendTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: topLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Top Legend Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegend
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp RightLegendTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: rightLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Right Legend Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegend
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp BottomLegendTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: bottomLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Bottom Legend Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegend
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp LeftLegendTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: leftLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Left Legend Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegend
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp TopLegendPositionTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: topLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Top Legend Position Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legendPosition: "top",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegendPosition: testLegendPosition
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp RightLegendPositionTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: rightLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Right Legend Position Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legendPosition: "right",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendPosition
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp BottomLegendPositionTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: bottomLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Bottom Legend Position Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legendPosition: "bottom",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendPosition
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp LeftLegendPositionTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: leftLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Left Legend Position Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legendPosition: "left",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendPosition
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp TopLegendItemsLengthTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: topLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Top Legend Items Length Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsLength
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp RightLegendItemsLengthTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: rightLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Right Legend Items Length Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsLength
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp BottomLegendItemsLengthTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: bottomLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Bottom Legend Items Length Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsLength
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp LeftLegendItemsLengthTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: leftLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Left Legend Items Length Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsLength
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp TopLegendItemsTextTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: topLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Top Legend Items Text Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsText
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp RightLegendItemsTextTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: rightLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Right Legend Items Text Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsText
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp BottomLegendItemsTextTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: bottomLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Bottom Legend Items Text Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsText
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }),
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp LeftLegendItemsTextTest = new LegendTestTemplate({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp dataProvider: basicDataValues,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp render: "#mychart",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp legend: leftLegend()
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp }, {
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp name: "Left Legend Items Text Test",
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp testLegend: testLegendItemsText
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp });
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(NoLegendTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(TopLegendTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(RightLegendTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(BottomLegendTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(LeftLegendTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(TopLegendPositionTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(RightLegendPositionTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(BottomLegendPositionTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(LeftLegendPositionTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(TopLegendItemsLengthTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(RightLegendItemsLengthTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(BottomLegendItemsLengthTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(LeftLegendItemsLengthTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(TopLegendItemsTextTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(RightLegendItemsTextTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(BottomLegendItemsTextTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp suite.add(LeftLegendItemsTextTest);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp //create the console
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp var r = new Y.Console({
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp newestOnTop : false,
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp style: 'block' // to anchor in the example content
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp });
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp r.render('#testLogger');
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp //run the tests
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp Y.Test.Runner.setName("Y.Charts.Legend");
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp Y.Test.Runner.add(suite);
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp Y.Test.Runner.run();
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp});
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp</script>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp</body>
3a0e3386da06b00e0461e54ce61efafa74ed0da0Tripp</html>