Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
Created January 11, 2011 16:22
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 bryanjswift/774654 to your computer and use it in GitHub Desktop.
Save bryanjswift/774654 to your computer and use it in GitHub Desktop.
/* Graph */
#graph { padding: 5px; width: 477px; height: 299px; }
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Raphael Test</title>
<link rel="stylesheet" type="text/css" href="raphaelTest.css">
</head>
<body>
<div id="graph"></div>
<script src="raphael-min.js" type="text/javascript"> </script>
<script src="raphaelTest.js" type="text/javascript"> </script>
</body>
</html>
var holder = document.getElementById('graph')
, width = holder.scrollWidth - 10
, height = Math.round(width * 0.5625) + 25
, p = Raphael(holder, width, height)
, c = p.circle(p.width - 50, p.height - 50, 50);
alert(p.width + ' & ' + p.height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment