Skip to content

Instantly share code, notes, and snippets.

@wecing
Created August 1, 2013 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wecing/6134963 to your computer and use it in GitHub Desktop.
Save wecing/6134963 to your computer and use it in GitHub Desktop.
YUI charts bug demo
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
</head>
<body>
<div id="chart-div" style="width:400px;height:400px;"></div>
<script src="http://yui.yahooapis.com/3.11.0/build/yui/yui-min.js"></script>
<script type="text/javascript" charset="utf-8">
YUI().use('charts', function(Y) {
// 1st
var myDataValues = [
{category:"5/1/2010", values:2000},
{category:"5/2/2010", values:50},
{category:"5/3/2010", values:400},
{category:"5/4/2010", values:200},
{category:"5/5/2010", values:5000}
];
var chart = new Y.Chart({
type: 'line',
dataProvider: myDataValues,
render: "#chart-div"
});
chart.render('#chart-div');
// 2nd
var myDataValues = [
{category:"5/1/2010", values:90000000000000},
{category:"5/2/2010", values:89990000000000},
{category:"5/3/2010", values:77000000000000},
{category:"5/4/2010", values:91000000000000},
{category:"5/5/2010", values:90000000000000}
];
chart.set('dataProvider', myDataValues);
chart.render('#chart-div');
// 3rd
var myDataValues = [
{category:"5/1/2010", values:20},
{category:"5/2/2010", values:50},
{category:"5/3/2010", values:40},
{category:"5/4/2010", values:20},
{category:"5/5/2010", values:50}
];
chart.set('dataProvider', myDataValues);
chart.render('#chart-div');
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment