Morphic Molecules
jsChart
A Javascript Programmable Chart Applet
These pages and Morphic Molecules Components, VBX's,
XCMDs, and images
are Copyright Mona M. Everett, Ph.D., 1995
everett@txdirect.net
Morphic Molecules Home Page
Morphic Molecules Services
Member of
the Internet Link Exchange
jsChart is derived from Sun's demonstration Chart Applet. In order for Javascript to interact directly for an applet, the applet must have public variables or methods. The original chart applet has none and so the only way to change applet parameters on the fly is to do a dynamic write/rewrite of a page containing the applet. This method will work in Netscape 2.02 or 3.0. You can see it work on the page Programming Java Applet Parameters
jsChart.class has been created in order to make the chart applet amenable to direct control by Javascript. Although making all of the variables public might seem the easiest way to do this, a changed variable will not be manifest unless a repaint occurs. Sometimes, other variables must also be changed. Consequently, a collection of public methods was developed for the applet; these can be called from Javascript. Parameters for all of these should be passed as strings
- setHorizontal()
- setVertical()
- setOrientation(which)
- setTitle(towhat)
- setScale(towhat)
- setColumns(howmany)
- setStyle(which,towhat)
- setColor(which,towhat)
- setValue(which,towhat)
- setLabel(which,towhat)
Three new parameters have been added to the applet:
- dwidth -- should be the same as WIDTH of the applet
- dheight -- should be the same as HEIGHT of the applet
- maxcolumns -- the maximum no of columns you expect to graph to display under any circumstances. This may be different from 'columns' which is the number of columns to display upon initialization.
You cannot change the applet dimensions or positioning once it has been drawn.
This page provides a worksheet for you to tryout jsChart's new Javascript callable routines. If you want to use the applet for your NON-COMMERCIAL pages, you can download a zip file with both the source and class files.
The source.
This page was last updated on
Mail comments about Morphic Molecules pages to
everett@txdirect.net