Created
November 9, 2012 02:36
-
-
Save echen/4043372 to your computer and use it in GitHub Desktop.
gg.js demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| var barchart = gg({ | |
| layers: [{ geometry: 'interval', mapping: { x: 'x', y: 'y' }, color: 'blue', width: 2 }] | |
| }); | |
| var w = 960; | |
| var h = 500; | |
| var ex = function () { return d3.select('#examples').append('span'); }; | |
| var data = [{x: 1, y: 2}, {x: 3, y: 5}, {x: 4, y: 2}]; | |
| barchart.render(w, h, ex(), data); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>gg.js demo</title> | |
| <link rel="stylesheet" type="text/css" href="https://dl.dropbox.com/u/10506/blocks/gg.css" /> | |
| <script src="https://dl.dropbox.com/u/10506/blocks/json2.js"></script> | |
| <script src="http://d3js.org/d3.v2.min.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script> | |
| <script src="https://dl.dropbox.com/u/10506/blocks/gg.js"></script> | |
| </head> | |
| <body> | |
| <div id="examples"></div> | |
| <script src="demo.js"></script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment