Author(s): Isabel Martín.
Version: 1.10#7 (2006/4/26, 19:22:13 CEST)
Version of last change: 1.9#267 (2004/1/1, 14:9:7 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').
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').
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').
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.