http://mbostock.github.com/d3/talk/20111018/#12
http://mbostock.github.com/d3/talk/20111018/#15
Mike
>In SVG 0,0 is in the top left. I start my bars from h - y(value) and
>each of them is y(value) in height. This makes them look like they
>start at the bottom when really they are starting at the top of each
>bar and being drawn "downward" (from the top of the screen down)
>
>The scale you quote from 0 -> w is just in the x direction. If you
>want to draw something at the bottom of the screen you need to
>translate in the y direction (or set the y component).
I can't help with the d3 or Javascript because I'm just a lurker at
the moment hoping to glean what I need to get started, but I
regularly use cartesian coordinates in my drawings and here's a
simple example of how I combine figures and text in a cartesian
plane. Once you have established the matrix to put zero at the
bottom of the chart, then all y values for the figures will be normal
for the figures but, because the text is inverted by the cartesian
configuration, the y values for text elements need to be negative, so
a line at y=20 lines up with text at y=-20:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" /> <title>chart</title>
</head>
<svg height="405" width="405"
fill="none" stroke="navy" stroke-width=".1">
<g id="MAIN"
transform="matrix(4 0 0 -4 10 405)">
<rect x="0" y="2" width="98" height="98" fill="aliceblue" />
<path transform="translate(10 10)" d="
M 0 0 h 85
M 0 10 h 85
M 0 20 h 85
M 0 30 h 85
M 0 40 h 85
M 0 50 h 85" />
<g id="TEXT"
transform="scale(1 -1) translate(5 -8.8)"
style="stroke:none;fill:navy;font-size:3pt;">
<text y="0">0</text>
<text y="-10">10</text>
<text y="-20">20</text>
<text y="-30">30</text>
<text y="-40">40</text>
<text y="-50">50</text>
</g>
</g>
</svg>
</html>
JD