James Black's suggestion to use the canvas tag, is a very good one, but it requires a non IE updated browser. Or does it? Thanks to google, you will be able use the Chrome Renderer within IE. This way you'd target HTML5 enabled browsers (Gecko, Webkit and Presto) with your dynamic graphs, and ask IE users to install Google's Add on once it comes out. canvas
works cross browser thanks to native support in everything non-IE, and to Google's Explore Canvas plugin for IE. SVG
support is also available cross browser thanks to some plugins for IE. Note that if you require the Chrome Renderer for IE, you don't need anything else.
You could either use canvas
or svg
to do the graphs, and there are already some libraries to do so. Both technologies allow you to create dynamic graphs, but they have some different approaches.
SVG canvas
-------------------------------------------------------------------------------
Has scene DOM (SVG DOM, though) Single HTML element,
rendering script-driven
Deals in shapes Deals in pixels
Somewhat hard to mix with HTML (not XHTML) Behaves like an image in both
Event handling easy Event handling hard
I'd think that I'd go with SVG
to do what you want, as it will be dead simple to add dynamic labels to it, but it will be hard to create a truly flexible API for pseudo 3D scatter plots.
The problem with svg
is that by attempting to make a very flexible language, you have a very complex one. Here you can see code written in both libraries that do the same thing.
SVG
var rect = document.createElementNS(SVG_NS, "rect");
rect.setAttribute("x", "5");
rect.setAttribute("y", "5");
rect.setAttribute("width", "20");
rect.setAttribute("height", "20");
rect.setAttribute("fill", "red");
parent.appendChild(rect);
var poly = document.createElementNS(SVG_NS, "polygon");
poly.setAttribute("fill", "green");
poly.setAttribute("points", "-40,40 0,-40, 40,40");
parent.appendChild(poly);
Canvas
with (ctx) {
fillStyle = "red";
fillRect(5, 5, 20, 20);
}
with (ctx) {
fillStyle = "green";
beginPath();
moveTo(-40, 40);
moveTo(0, -40);
moveTo(40, 40);
closePath();
fill();
}