Worked Example Middle East Oil
Adding the headings and a footnote
The next stage is to add the text (and font definitions) for the heading, subhead and footnote:
grapl.XStyle = "NoAxis"
grapl.Heading = "Middle East Oil Production"
grapl.HeadingFont = "ARB,18,Black"
grapl.HeadingStyle = "Left"
grapl.Subhead = "Production, 1000s of Barrels/day"
grapl.SubheadFont = "AR,12,Black"
grapl.Footnote = "Source BP (1999 figures)"
grapl.FootnoteStyle = "Right,Ruled"
grapl.FootnoteFont = "AR,12,Black"
grapl.Barchart Col_Barrels
Response.Write grapl.RenderVML
GraPL works with a set of short mnemonics for the common fonts in this case AR is Arial and to use the bold variant we require ARB. You can define your own short codes for any available fonts in the script, but for web-page generation it generally pays to stay with the fonts which are likely to be present on most browsers. By default you can use TI, AR and CO (suffixed with B,I,BI as necessary) for the basic Times, Arial and Courier fonts, and also WING to signify Wingdings.
Note that we also turned off the x-axis completely (the value labels are sufficient) and ruled above the footnote, which was aligned to the right of the available space. We have to be a little inventive to get the y-axis to look how the Guardians designers wanted it we cannot turn it off completely as the gridlines and labels will vanish, but what we can do is turn off the tickmarks and draw the axis using the invisible line-style! This iteration also sets the bar colour to the house-style brick red and the pattern to solid fill:
grapl.Colours = "#A7322C"
grapl.Patterns = "Solid"
grapl.Axes = "Black,Invisible,1"
grapl.Barchart Col_Barrels
Response.Write grapl.RenderVML
This completes the main barchart to the initial design.
|