Author(s): Isabel Martín.
Version: 1.10#7 (2006/4/26, 19:22:13 CEST)
Version of last change: 1.9#271 (2004/1/1, 14:21:46 CET)
This module defines predicates which show barchart widgets. These bar charts are somewhat different from the bar charts generated by the predicates in modules genbar1, genbar2, genbar3 and genbar4. Predicates in the present module show different features of each dataset element in one chart at the same time. Each bar chart element is a group of bars, and the element features involve three vectors defined as follows:
Other relevant aspects about this widgets are:
"
as the value of the argument.
error2
will be thrown. If the vectors contains elements but are not correct, the exception error5
or error6
will be thrown, depending on what is incorrect. error5
means that XVector
and each element of YVector
do not contain the same number of elements or that YVector
and BarsAtt
do not contain the same number of elements, while error6
indicates that not all the BarsAtt
elements contain a correct number of attributes.
The examples will help you to understand how these predicates should be called.
genmultibar
)genmultibar
)
multibarchart(Header, BTitle, XTitle, XVector, YTitle, BarsAtts, YVector, Footer)
The x axis limits are autoarrange. The user can call the predicate in two ways. In the first example the user sets the appearance of the bars, in the second one the appearance features will be chosen by the library.
Example1:
multibarchart('This is the Header text', 'My BarchartTitle', 'Processors', ['processor1','processor2','processor3','processor4'], 'Time (seconds)', [['setup time','MediumTurquoise','Plum','pattern2'], ['sleep time','Blue','Green','pattern5'], ['running time','Yellow','Plum','pattern1']], [[20,30,40,50],[10,8,5,35],[60,100,20,50]], 'This is the Footer text').
Example2:
multibarchart('This is the Header text', 'My BarchartTitle', 'Processors', ['processor1','processor2','processor3','processor4'], 'Time (seconds)', [['setup time'],['sleep time'],['running time']], [[20,30,40,50],[10,8,5,35],[60,100,20,50]], 'This is the Footer text').
multibarchart(Header, BT, XT, XVector, YT, BAtts, YVector, YMax, YMin, Footer)
This predicate is quite similar to
multibarchart/8
, except in that you can choose limits in the y axis. The part of the bars placed outside the limits will not be plotted.
Example2:
multibarchart('This is the Header text', 'My BarchartTitle', 'Processors', ['processor1','processor2','processor3','processor4'], 'Time (seconds)', [['setup time'],['sleep time'],['running time']], [[20,30,40,50],[10,8,5,35],[60,100,20,50]], [80], [0], 'This is the Footer text').
genmultibar
)multibar_attribute([LegendElement]) :- atomic(LegendElement). multibar_attribute([LegendElement,ForegroundColor,BackgroundColor,StipplePattern]) :- atom(LegendElement), color(ForegroundColor), color(BackgroundColor), pattern(StipplePattern).
Defines the attributes of each feature bar along the different datasets.
LegendElement
value of the list must be unique.
ForegColor
BackgColor
SPattern
xelement(Label) :- atomic(Label).
This type defines a dataset label. Although Label
values may be numbers, the will be treated as atoms, So it will be displayed at uniform intervals along the x axis.
Go to the first, previous, next, last section, table of contents.