The optional argument ⟨options⟩ is a key=value list where the following keys are available:
- The maximum x-axis value. (The
default is 100.)
- The minimum x-axis value. (The
default is 0.)
- The step size along the x-axis.
- For irregular intervals or if rounding errors
cause a problem for the
stepoption, this option can be used instead. The value should be a comma-separated list of intervals along the x-axis.
- Hides all the tick marks along the
- Specifies a unit to append to all
the values displayed on the chart. The default is empty.
- Sets the width of the chart. The
default is 8 cm. This setting doesn't change the
height of the chart.
- Scales both the width and height,
maintaining the aspect ratio. (This doesn't change the text size.)
This can be redefined using
\renewcommand or set to empty to
use the document font. The default definition is
\sf, which is an
obsolete font changing command and may cause issues with some classes
such as the KOMA-Script classes. I suggest you redefine
to use a modern declaration, such as
\sffamily. For example:
bchart environment, the bars are displayed
where ⟨number⟩ is the bar's value. The optional argument ⟨options⟩ is a key=value list with the following keys:
- Sets the text displayed inside the
bar (to the right of the y-axis).
- Sets the label displayed on the left
of the y-axis.
- Sets the bar colour.
- Hides the bar's value, which by
default is displayed to the right of the bar.
- Sets the value displayed to the
right of the bar. The default is the ⟨number⟩ in the mandatory
You can insert vertical gaps between bars using:
Within the scope of the
bchart environment, the standard
\bigskip are redefined in terms of
\bcskip and may be used to insert
small, medium or large gaps. As with
\bcskip, these three
commands also have an optional argument. This option only has one
label, which specifies a label.
A “free” label is placed to the left of the y-axis at the current location using:
where ⟨text⟩ is the label text. This doesn't add any gap or bar to the chart.
The x-axis can be labelled using:
Reproduce the bar chart shown in Figure 12.9. (The bar
colours are the default setting.) Hint: if you actually try to enter
values such as 75000 you are likely to get a “Dimension
too large” error, so enter the numbers as one thousandth of the
actual value and set the
unit key so that the numbers are
displayed as shown.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).