Bar charts¶
The barchart pad builds a barchart{} figure: one bar
per category, its height its value, drawn to a scale on the value axis.
Each field of the form is one part of the atmxg string, shown below the
preview. The pad speaks French; its labels are quoted here as they read.
Printing¶
| Field | What it sets |
|---|---|
| Facteur d'échelle | multiplies every length on paper, to make up for the printer — as in every pad (see Plots) |
| 1 cm représente | what one centimetre of the value axis stands for. Empty: the chart keeps the proportions automath gives it, as automath render svg draws it; the scale that comes out is said under the preview, 1 cm pour 4,2 environ |
| Taille du texte (pt) | the size of everything written, 12 when empty |
| Largeur des barres (cm) | empty: automath's width, proportionate to the text |
Left to automath, the value axis is chart_height_ratio font sizes long (9 by
default), lengthened where its written values would come too close: the pad
then sizes the chart by its text, so many points high, and the scale is
whatever comes out. Give a scale where it matters — where pupils measure the
bars, or draw them: the scale and the text size together make
unit_length_ratio, the length of one unit in font sizes, 1 cm représente 5
at 12 pt writing unit_length_ratio=0.4724. The value axis then has exactly that length,
however close its written values come: choose fewer of them (Valeurs écrites
tous les) where they would touch. A bar width becomes bar_width_ratio and
max_bar_width_ratio, both set to it.
The size the chart takes on paper, and its text, are shown under the preview.
Chart¶
| Field | Option |
|---|---|
| Légende des catégories / des valeurs | x_title, y_title |
| Couleur des barres | color |
| Grille entre les barres, Grille des valeurs | x_grid=true, y_grid=true |
| Barres horizontales | swap_axes=true |
| Première barre en bas | from_bottom=true, with horizontal bars only |
| Valeur min, Valeur max | y_min, y_max — 0 and automath's choice when empty |
| Graduations tous les, Valeurs écrites tous les | y_step, y_labels_step |
| Autres options barchart{} | any other option, written as it is typed, last: grid_opacity=0.4 ; bar_spacing_ratio=2 |
A value below the minimum of the axis, or above its maximum, is marked in error; so is a negative value while no minimum is given.
Bars¶
A bar has a label, a value and a colour. The label may span several lines:
Enter starts a new one (\n in the string). A label holding no brace may
hold anything else; one holding a ; is wrapped in {…}. The value is a
number, typed with a comma or a dot.
The colour of a bar is Celle des barres (the colour of the chart) unless one
is chosen for it: those make bar_colors, _ standing for the others. The
arrows move a bar before or after its neighbour.
Output and import¶
As in the plot pad: the SVG, sized in
centimetres, its fonts embedded or not; the atmxg string, to copy or save as
diagramme.atmxg.
Importer un .atmxg… takes a file holding one barchart{}, and nothing
else, that automathd draws. The string holds the scale and the text size
only together (unit_length_ratio): the form reads them at 12 pt where that
gives a round scale, and otherwise guesses another size, which it says — check
both fields then. A chart with no unit_length_ratio keeps automath's
proportions, 1 cm représente left empty. A colour other than #rrggbb gives way to the default; an option
without a field is kept in Autres options barchart{}, as written.