GraPL > GraPL Desktop > Tutorials > Mobiles > Initial layout
 

Axes, Colours and Headings

So far we have made a reasonable-looking barchart, but it is not quite what the original design called for. Just as a reminder of where we are aiming, here is the final version again:


Some of the detailed design work which is left to be done:

  • The bar colours are wrong – the Guardian standardises on dull cyan and brick red for all its coloured graphs, so we must respect the house style!
  • There should be a small gap between the groups of bars, but within a group the bars should touch
  • The heading and subheading should both be left-aligned
  • There is a footnote, giving the source of the data
  • The y-axis is not drawn at all, the x-axis is labelled but no axis line is drawn here
  • The bars are themselves labelled with the data values, drawn inside each bar
  • The entire chart has a grey background, and the key has a white rectangle drawn under it

As I said at the start, this chart is a really good subject for a tutorial, as it gives us a chance to investigate many of the less-common settings in GraPL. When we have finished, we can save our design as a template, so that next time we need this style, we have one ready and waiting!

Fixing the Y-axis

This is very simple to do – open up the Axis properties tree and click the ‘ ... ’ button in the ‘Y-Style’ field:

As you can see, there are a lot of things you can do to an axis! ‘ForceZero’ is already checked, and I have also switched the axis position from ‘Standard’ to ‘NoAxis’ which turns it off completely. You can also have the axis line drawn but unlabelled by requesting ‘Plain’ tickmarks, or labelled without tickmarks with ‘NoTick’. When you exit the style dialogue with OK you will notice that the words ‘ForceZero,NoAxis’ have appeared in the property field – as you get to know GraPL better you will find that you can save a lot of time by just typing these options straight in to the edit-box. Only the first 4 letters are essential, and you can type in lower-case, so here you would just need ‘forc,noax’ to have it work as you would expect – try it!

Setting the colour sequence

This brings us to an important part of the way GraPL works – because you can combine many different chart types on the same finished graphic, it is simplest to set up the colours, shading patterns, line-styles and so on at the start, and then your data-series will simply cycle through the colours as you plot them. GraPL is pre-loaded with a set of colours and shadings which make good, easy to discriminate, sets of bars (particularly when you print the graph on a monochrome printer) so you would usually leave them alone. However in this case we must make sure they look like the original, so bring back that split window and select the ‘Settings’ tab.

I have dragged a colour palette and a pattern cycle to the top of the chart definition. These must be in the definition above the chart which they apply to, and I normally put them right at the front. If we start with the colours, the numbers are simply the colour-numbers in the standard 16-colour palette – you can use names if you prefer. Press the ‘...’ button (or Ctrl+Enter on the edit field) to build a new colour cycle:

You can reduce the number of colours to 2 with the spinner, and select a suitable dark cyan and brick red for each one. Click the colours in the list in turn and hit the ‘...’ next to the colour swatch to choose from the standard Windows colour chooser. Save the cycle, and change the Pattern cycle from ‘2,6,1,5’ to ‘Solid’ to have all the bars drawn in full colour – the default is to use a set of varying half-tones. You should now see a chart rather like:

Notice that when you save the colours, GraPL shows the ‘non-standard’ colours in the same format as you would use when setting up a web page. If you have Paint Shop Pro, you can use its excellent colour-wheel to choose your colour, and use the clipboard to paste these ‘hex’ values directly into the field.

Setting the Headings and bar spacing

Now it is mostly downhill – we have done the hard stuff! Set the heading text to “Mobile Phone Subscribers” and the heading placement to ‘left’. The original has 24-point Arial bold, black here – either use the ‘...’ for the heading font or simply type ‘Arb,24,black’ into the edit field.

GraPL has short, easy-to-type abbreviations for the common fonts – use ‘Ti’ for Times and ‘Ar’ for Arial, adding ‘b’, ‘i’ or ‘bi’ as you need them to make Bold, Italic and Bold-Italic versions. Of course you can set up your own short-codes so you use any font on your computer – that is what the ‘DefineFont’ setting does for you. Set the subheading to “Millions” and the subhead font to ‘Ar,12’ (the subheading always has the same placement as the main heading), and set the footer to “Data from the Guardian newspaper, January 2000”, the footnote placement to ‘Left’ and the font to ‘Ar,10’. If you like the effect, check the ‘ruled’ option at the same time (I left this off in the examples). You can set the axis label font to ‘Ar,14’ to complete the effect (uncurl the Axes properties to find this).

Now we can adjust the bar spacing, GraPL has two settings which control this – the ‘Gap’ property sets the ratio of the gap within groups to the bar width, and the ‘Group gap’ sets the same ratio for the gap between groups of bars. They are pre-set to the famous ‘Golden number’ of 0.618:1:1.618, but here we need 0 between the bars and 0.8 between the groups. Now your chart should look like this:

OK, we have a problem! There is not enough room in the top margin for the big heading and the subhead – we need to fix the chart margins! Also you will notice that the X-axis line is still drawn, which requires a little ingenuity to get around.


Continue to: Tidying Up


© Copyright Causeway Graphical Systems Ltd 2000-2007
Telephone: +44 (0)1439 788413