Author(s): Isabel Martín García.
Version: 1.11#222 (2004/5/24, 13:8:7 CEST)
Version of last change: 1.11#146 (2004/1/1, 14:9:17 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 the genbar1 module except in that these defined in this module do not display a legend. Thus, not all the argument types are equal.
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 contain 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 .
genbar3)genbar3)
barchart3(Header, BarchartTitle, XTitle, XVector, YTitle, YVector, Footer)
As we mentioned in the above paragraph, this predicate is comparable to
barchart1/8 except in the XVector argument type.
Example:
barchart3('This is the header text',
'Barchart without legend',
'My xaxistitle',
[['bar1'],['bar2']],
'My yaxixtitle',
[20,10],
'This is the footer text').
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 xbarelement3s.
(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 yelements.
(basic_props:list/2)
Footer is a text (an atom) describing the footer of the graph.
(genbar1:footer/1)
barchart3(Header, BTitle, XTitle, XVector, YTitle, YVector, YMax, YMin, Footer)
As we mentioned, this predicate is quite similar to the
barchart1/10 except in the XVector argument type, because the yielded bar chart lacks of legend.
Example:
barchart3('This is the header text',
'Barchart without legend',
'My xaxistitle',
[['bar1'],['bar2']],
'My yaxixtitle',
30,
5,
[20,10],
'This is the footer text').
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 xbarelement3s.
(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 yelements.
(basic_props:list/2)
genbar1:axis_limit(YMax)
(genbar1:axis_limit/1)
genbar1:axis_limit(YMin)
(genbar1:axis_limit/1)
Footer is a text (an atom) describing the footer of the graph.
(genbar1:footer/1)
percentbarchart3(Header, BTitle, XTitle, XVector, YTitle, YVector, Footer)
The y axis maximum coordinate value is 100. The x axis limits are autoarrange.
Example:
percentbarchart3('This is a special barchart to represent percentages',
'Barchart without legend',
'My xaxistitle',
[ ['pr1','Blue','Yellow','pattern1'],
['pr2','MediumTurquoise','Plum','pattern5'] ],
'My yaxixtitle',
[80,10],
'This is the footer text').
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 xbarelement3s.
(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 yelements.
(basic_props:list/2)
Footer is a text (an atom) describing the footer of the graph.
(genbar1:footer/1)
genbar3)
xbarelement3([XValue]) :-
atomic(XValue).
xbarelement3([XValue,ForegColor,BackgColor,StipplePattern]) :-
atomic(XValue),
color(ForegColor),
color(BackgColor),
pattern(StipplePattern).
Defines the attributes of the bar.
XValue
XValue values may be numbers, the will be treated as labels. Different elements with the same label will produce different bars.
ForegColor
BackgColor
SPattern
Go to the first, previous, next, last section, table of contents.