PDA

View Full Version : Did you know you could draw diagrams with JavaScripts?



SpiritualStorms
07-10-2004, 05:56 PM
I was going to the Documentation thread of this section, and i saw a link that lead me to a rather interesting site. Here's the link:
http://home.t-online.de/home/lutz.tautenhahn/diagram/introduction.html

At any rate, i did not know you could do diagrams with JavaScript. Imagine that.

Here's an example of the methods that can be used:



<script language="">

document.open();

var D = new Diagram();

D.setFrame( 80, 160, 420, 360 );
D.setBorder( 10, 50, 0, 4 );
D.setText( "X-Lavel" , "Y-Label" , "Title" );
D.setGridColor( "#44cc44" );
D.Draw( "#80ff80" , "#0000ff" , true, "Click On Me!" , "DiagramClick()" );

document.close();

function DiagramClick() {
alert( "Use your own function here!" );
}
</script>


Pretty little fish, isn't she?

scroots
07-10-2004, 11:36 PM
all it is that someone has written a script to provide a platform for them to easily make charts.

scroots

jbot
07-12-2004, 10:36 AM
i believe there's an ancient script on DevEdge (http://devedge.netscape.net/) for creating diagrams using JS.

however, you could use JS to invoke SVG commands, and create diagrams, such as pie charts like that.