Go to the first, previous, next, last section, table of contents.


Multi barchart widgets

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:

The examples will help you to understand how these predicates should be called.

Usage and interface (genmultibar)

Documentation on exports (genmultibar)

PREDICATE: multibarchart/8:

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').

PREDICATE: multibarchart/10:

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').

Documentation on internals (genmultibar)

REGTYPE: multibar_attribute/1:
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
Legend element name. It may be a number or an atom. Every LegendElement value of the list must be unique.
ForegColor
It sets the Foreground color of the bar. Its value must be a valid color, otherwise the system will throw an exception. If the argument value is a variable, it gets instantiated to a color chosen by the library.
BackgColor
It sets the Background color of the bar. Its value must be a valid color, otherwise the system will throw an exception. If the argument value is a variable, it gets instantiated to a color chosen by the library.
SPattern
It sets the stipple of the bar. Its value must be a valid pattern, otherwise the system will throw an exception. If the argument value is a variable, it gets instantiated to a pattern chosen by the library.

REGTYPE: xelement/1:

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.