Author(s): Isabel Martín García.
Version: 1.11#222 (2004/5/24, 13:8:7 CEST)
Version of last change: 1.11#147 (2004/1/1, 14:16:0 CET)
This module defines predicates which depict barchart widgets. The three predicates exported by this module plot two-variable data as regular bars in a window and are similar to those exported in genbar2 module except in that those defined in this module doesn't display a legend. Thus, the user does not have to define legend element names.
The predicates test whether the format of the arguments is correct. If one or both vectors are empty, the exception error2
will be thrown. If the vectors contains elements but are not correct, the exception error1
or error3
will be thrown, depending on the error type. error1
means that XVector
and YVector
do not contain the same number of elements and error3
indicates that not all the XVector
elements contain a correct number of attributes .
genbar4
)genbar4
)
barchart4(Header, BarchartTitle, XTitle, XVector, YTitle, YVector, Footer)
As we mentioned in the above paragraph, this predicate is comparable to
barchart2/8
except in the XVector
argument type.
Example:
barchart4('This is the header text', 'Barchart without legend', 'My xaxistitle', [[2],[5],[6]], 'My yaxixtitle', [20,10,59], 'Numeric values in the xaxis').
Usage:
Header
is a text (an atom) describing the header of the graph.
(genbar1:header/1
)
BarchartTitle
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
XTitle
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
XVector
is a list of xbarelement4
s.
(basic_props:list/2
)
YTitle
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
YVector
is a list of yelement
s.
(basic_props:list/2
)
Footer
is a text (an atom) describing the footer of the graph.
(genbar1:footer/1
)
barchart4(Hder, BT, XT, XVector, XMax, XMin, YT, YVector, YMax, YMin, Fter)
As we stated before, this predicate is quite similar to
barchart2/10
except in the following aspects:
XVector
argument type, because the yielded bar chart lacks the legend.
x
axis and y
axis.
Example:
barchart4('This is the header text, you can write a graph description', 'Barchart without legend', 'My xaxistitle', [[2,'Blue','Yellow','pattern1'], [20,'MediumTurquoise','Plum','pattern5'], [30,'MediumTurquoise','Green','pattern5']], 50, -10, 'My yaxixtitle', [20,10,59], 100, -10, 'Numeric values in the xaxis').
Usage:
Hder
is a text (an atom) describing the header of the graph.
(genbar1:header/1
)
BT
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
XT
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
XVector
is a list of xbarelement4
s.
(basic_props:list/2
)
genbar1:axis_limit(XMax)
(genbar1:axis_limit/1
)
genbar1:axis_limit(XMin)
(genbar1:axis_limit/1
)
YT
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
YVector
is a list of yelement
s.
(basic_props:list/2
)
genbar1:axis_limit(YMax)
(genbar1:axis_limit/1
)
genbar1:axis_limit(YMin)
(genbar1:axis_limit/1
)
Fter
is a text (an atom) describing the footer of the graph.
(genbar1:footer/1
)
percentbarchart4(Header, BTitle, XTitle, XVector, YTitle, YVector, Footer)
The y axis maximum coordinate value is 100. The x axis limits are automatically worked out. This predicate is useful when the bar height represents percentages.
Example:
percentbarchart4('This is the header text', 'Barchart without legend', 'My xaxistitle', [[2,'Blue','Yellow','pattern1'],[5,'Yellow','Plum','pattern5'], [6,'MediumTurquoise','Green','pattern5']], 'My yaxixtitle', [20,10,59], 'Numeric values in the xaxis').
Usage:
Header
is a text (an atom) describing the header of the graph.
(genbar1:header/1
)
BTitle
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
XTitle
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
XVector
is a list of xbarelement4
s.
(basic_props:list/2
)
YTitle
is a text (an atom) to be used as label, usually not very long.
(genbar1:title/1
)
YVector
is a list of yelement
s.
(basic_props:list/2
)
Footer
is a text (an atom) describing the footer of the graph.
(genbar1:footer/1
)
genbar4
)Defines the attributes of the bar.
XValue
ForegColor
BackgColor
SPattern
Go to the first, previous, next, last section, table of contents.