Skip to content

Instantly share code, notes, and snippets.

@toobulkeh
Created November 19, 2012 21:53
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 toobulkeh/4114282 to your computer and use it in GitHub Desktop.
Save toobulkeh/4114282 to your computer and use it in GitHub Desktop.
YUI Chart Test
<?php
$chartData = array(array("category"=>"5/1/2010","miscellaneous"=>2000,"expenses"=>3700),
array("category"=>"5/2/2010","miscellaneous"=>50,"expenses"=>9100),
array("category"=>"5/3/2010","miscellaneous"=>400,"expenses"=>1100),
array("category"=>"5/4/2010","miscellaneous"=>200,"expenses"=>1900),
array("category"=>"5/5/2010","miscellaneous"=>5000,"expenses"=>5000));
?>
<script>
// Create a new YUI instance and populate it with the required modules.
YUI().use('charts', function (Y) {
var chartData = <? php echo json_encode($chartData)?>;
var myDataValues = [
{category:"5/1/2010", miscellaneous:2000, expenses:3700, revenue:2200},
{category:"5/2/2010", miscellaneous:50, expenses:9100, revenue:100},
{category:"5/3/2010", miscellaneous:400, expenses:1100, revenue:1500},
{category:"5/4/2010", miscellaneous:200, expenses:1900, revenue:2800},
{category:"5/5/2010", miscellaneous:5000, expenses:5000, revenue:2650}
];
var mychart = new Y.Chart({
dataProvider:myDataValues,
render:"#mychart",
horizontalGridlines: {
styles: {
line: {
color: "#dad8c9"
}
}
},
verticalGridlines: {
styles: {
line: {
color: "#dad8c9"
}
}
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment