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


Depict barchart widgets - 4

Author(s): Isabel Martín.

Version: 1.10#7 (2006/4/26, 19:22:13 CEST)

Version of last change: 1.9#268 (2004/1/1, 14:15:51 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 .

Usage and interface (genbar4)

Documentation on exports (genbar4)

PREDICATE: barchart4/7:

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

PREDICATE: barchart4/11:

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:

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

PREDICATE: percentbarchart4/7:

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

Documentation on internals (genbar4)

REGTYPE: xbarelement4/1:

Defines the attributes of the bar.

XValue
x-coordinate position of the bar. Different elements with the same abscissas will produce overlapped bars.
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.


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