multiChart allows multiple charts on one web page displaying
data. (This is similar to the single
use chart but
requires a simple addition to the html code that loads the Flash).
This is an example
of a multipurpose bar chart written with Flash MX. It can be used
to simply create a personalized bar chart, graphically displaying
'positive numbers' with any number of individual entries, to help
make the information
chart can be scrolled if there are more bars than will fit on the
screen at once.
The captions and chart data are loaded into the Flash from a separate XML file
named 'data1.xml' (or 'data2.xml' etc. see below) created with a simple text
the data and displays the individual bars to the correct height in proportion
The highest bar shown is automatically scaled to the highest value from the data,
with the value at the base of the chart set by the author of the XML (i.e. it
doesn't have to be zero). For example, say the highest value is 200 and the author
sets the 'lowest' attribute in the XML file to 50, the bars would be
drawn in proportion from 200 the highest bar, to 50 the base of the chart.
A text box beneath
each individual bar indicator is controlled with the 'label' attribute
and can show one of two types of information. Either the data figure
for that bar in numerals, or a simple sequential
are dynamic and written by the author of the XML file.
the information from the xml file data1.xml:
information from the xml file data2.xml:
files have to be saved within
the same directory as the html file that actually loads
file, for the actionscript in the Flash movie to find it (in this example, in
the same directory as this html file you are viewing now 'index.html',
as it is the file that loads
The individual data items (named 1, 2, 3 etc. in the example shown below)
numerically or sequentially named, but the caption's attribute names do have
to be as shown although of course the content can be the author's own, i.e.
'title' must remain title but any text can be inserted between the " " marks.
The 'lowest' attribute is normally 0. It is not displayed but is used by the
Flash to determine the 'base line' value of the chart, it must be either
0, or equal
or lower than the lowest data number for the chart to display properly.
The 'label' attribute
controls what will be displayed in the text field beneath each bar. It should
or to "0" to display a simple sequential count.
below is an example listing of the 'data1.xml' file which has 100
entries. For each chart on a web page a separate xml file is
and named to link it to an individual chart (i.e. data2.xml,
Shown below is
an example of the standard html to include a Flash movie in
your web page. Each chart would have all the code below. The part
'links' each individual chart with its own data file is ?id=1 directly
after the name of the Flash movie (in this case multichart.swf).
This complete piece of code needs to be duplicated and changed
in both places as shown in red, for each separate
?id=3 etc.). Note: unless you want to use charts with different
backgrounds, you only need the one swf file - just load it with
the different code
that parses it a unique id number to match the xml file.