<html>
<head>
<style>
/*Supplemental: CSS for the YUI distribution*/
#custom-doc { width: 95%; min-width: 950px; }
#mychart {
padding:10px 10px 10px 10px;
}
</style>
</head>
<body class="yui3-skin-sam">
<h3>Group Marker Tests</h3>
<div id="mychart"></div>
<script>
YUI({
allowRollup: false,
filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min'
}).use('charts', 'test', 'console', function (Y)
{
var suite = new Y.Test.Suite("Y.GroupMarker"),
GroupMarkerTestTemplate = function(cfg, globalCfg)
{
var i;
cfg.height = cfg.height || 300;
cfg.groupMarkers = true;
cfg.interactionType = "planar";
cfg.render = "#mychart";
this.attrCfg = cfg;
for(i in globalCfg)
{
if(globalCfg.hasOwnProperty(i))
{
this[i] = globalCfg[i];
}
}
};
Y.extend(GroupMarkerTestTemplate, Y.Test.Case, {
setUp: function() {
},
testGroupMarkers: function()
{
var chart = this.chart,
keys = chart.get("seriesKeys"),
i = 0,
len = keys.length;
Y.Assert.isTrue(chart.get("groupMarkers"));
},
tearDown: function() {
this.chart.destroy(true);
}
});
Y.GroupMarkerTestTemplate = GroupMarkerTestTemplate;
var dataProvider = [
],
GroupMarkerTest = new Y.GroupMarkerTestTemplate({
seriesKeys: ["miscellaneous", "expenses", "revenue"],
dataProvider: dataProvider
},
{
name: "Group Marker Test"
}),
CircleMarkerTest = new Y.GroupMarkerTestTemplate({
seriesKeys: ["miscellaneous", "expenses", "revenue"],
dataProvider: dataProvider,
seriesCollection: [
{
type: "combo",
valueKey: "miscellaneous",
styles: {
marker: {
shape: "circle"
}
}
},
{
type: "combo",
valueKey: "expenses",
styles: {
marker: {
shape: "circle"
}
}
},
{
type: "combo",
valueKey: "revenue",
styles: {
marker: {
shape: "circle"
}
}
}
]
},
{
name: "Circle Marker Test"
}),
RectMarkerTest = new Y.GroupMarkerTestTemplate({
seriesKeys: ["miscellaneous", "expenses", "revenue"],
dataProvider: dataProvider,
seriesCollection: [
{
type: "combo",
valueKey: "miscellaneous",
styles: {
marker: {
shape: "rect"
}
}
},
{
type: "combo",
valueKey: "expenses",
styles: {
marker: {
shape: "rect"
}
}
},
{
type: "combo",
valueKey: "revenue",
styles: {
marker: {
shape: "rect"
}
}
}
]
},
{
name: "Rect Marker Test"
}),
DiamondMarkerTest = new Y.GroupMarkerTestTemplate({
seriesKeys: ["miscellaneous", "expenses", "revenue"],
dataProvider: dataProvider,
seriesCollection: [
{
type: "combo",
valueKey: "miscellaneous",
styles: {
marker: {
shape: "diamond"
}
}
},
{
type: "combo",
valueKey: "expenses",
styles: {
marker: {
shape: "diamond"
}
}
},
{
type: "combo",
valueKey: "revenue",
styles: {
marker: {
shape: "diamond"
}
}
}
]
},
{
name: "Diamond Marker Test"
}),
EllipseMarkerTest = new Y.GroupMarkerTestTemplate({
seriesKeys: ["miscellaneous", "expenses", "revenue"],
dataProvider: dataProvider,
seriesCollection: [
{
type: "combo",
valueKey: "miscellaneous",
styles: {
marker: {
shape: "ellipse"
}
}
},
{
type: "combo",
valueKey: "expenses",
styles: {
marker: {
shape: "ellipse"
}
}
},
{
type: "combo",
valueKey: "revenue",
styles: {
marker: {
shape: "ellipse"
}
}
}
]
},
{
name: "Ellipse Marker Test"
});
suite.add(GroupMarkerTest);
suite.add(CircleMarkerTest);
suite.add(RectMarkerTest);
suite.add(DiamondMarkerTest);
suite.add(EllipseMarkerTest);
//create the console
var r = new Y.Console({
newestOnTop : false,
style: 'block' // to anchor in the example content
});
r.render('#testLogger');
//run the tests
Y.Test.Runner.add(suite);
});
</script>
</body>
</html>