This package relies on a few gifs being present in /graphics/graphing-package/. It also relies on the presense of ad_proc and its helper procs in utilities. Make sure you always have the latest version of utilities every time you upgrade the ACS! The graphing Tcl procedures are in /tcl/ad-graphing.
If you want to do fancier charts like x-y-scatter graphs or pie charts, you should probably buy/find/write a cgi program that generates gifs on the fly (a popular free example is Gnuplot, distributed from http://www.cs.dartmouth.edu/gnuplot_info). In my experience, trying to do these the plain html way is very slow and limited.
The bar chart procedure, gr_sideways_bar_chart
returns
an HTML fragment. It has just one mandatory
argument, although there are a number of optional arguments to beautify
or improve your graphs. Because there are so many optional arguments,
the optional arguments are specified using flags (keyword arguments), like
Unix commands, instead of positionally like most tcl procedures.
To run this command:
gr_sideways_bar_chart subcategory_category_and_value_list
To use optional arguments, for instance legend
and
left_heading
:
gr_sideways_bar_chart -legend legend -left_heading left_heading subcategory_category_and_value_list
The arguments:
subcategory_category_and_value_list
To create a graph like this:
supplyDogs Samoyed xxxxxxxxxxx 45% Black Lab xxxx 20% Terrier xxxxxxxxxxxxxxxxxxxx 66% Cats Calico xxxxxxxx 39% Persian xx 10%
subcategory_category_and_value_list
as a Tcl list of lists:
[list [list "Samoyed" "Dogs" "45"] \
[list "Black Lab" "Dogs" "20"] \
[list "Terrier" "Dogs" "66"] \
[list "Calico" "Cats" "39"] \
[list "Persian" "Cats" "10"]]
Dogs and Cats are the categories, Samoyed, Black Lab, Terrier, Calico, and
Persian are subcategories, and all the numbers are values. You can have multiple
values per subcategory, in which case you should supply the values as a list:
[list [list "Samoyed" "Dog" [list "45" "65" "34"]] ...]
There can be an optional fourth argument, which specifies a URL to
link around the value displayed (if values are being displayed). If
provided, this overrides the setting of default_drilldown_url
below.
legend
legend
is a list of what the values refer to if there's more than one value
per subcategory.
So, if you have created a graph with three values per subcategory:
then create a legend likeDogs Samoyed xxxxxxxxxxx 45% ----------------------- 90% ++++++++++++++++++ 70% Black Lab xxxx 20% ------ 30% ++++++++++++ 60%
[list "March" "April" "May (projected)"]
bar_color_list
display_values_p
display_scale_p
display_scale_p
to "f".
It doesn't make sense to have the scale if the values that are being charted
are not percentages.
default_drilldown_url
$category
, $subcategory
,
and $value
may be referenced.
non_percent_values_p
min_left_column_width
min_left_column_width
to be
the same for each of them so that they will line up.
Otherwise, the left column, which contains the categories and subcategories, probably
won't be the same for successive charts.
bar_height
subcategory_spacing
compare_non_percents_across_categories
compare_non_percents_across_categories
to "t".
left_heading
right_heading
replace_null_subcategory_with_none_p